Description
In some places is common to remember a phone number associating its digits to letters. In this way the expression “MY LOVE” means 69 5683. Of course there are some problems, because some phone numbers can not form a word or a phrase and the digits 1 and 0 are not associated to any letter.
有些地方會用對應的字母來代替數字使得電話號碼更好記。如此一來 MY LOVE 就代表 69 5683。這不是萬靈丹,因為有的電話號碼並不能構成一個字或片語,而且 1 和 0 沒有對應的字母。
Your task is to read an expression and find the corresponding phone number based on the table below. An expression is composed by the capital letters (A-Z), hyphens (-) and the numbers 1 and 0.
你的任務是讀入一個字串並依據下表轉成電話號碼。字串由大寫字母 (A-Z)、連字號(-) 和數字 1 和 0 所組成。

Input
The input consists of a set of expressions. Each expression is in a line by itself and has C characters, where 1 ≤ C ≤ 30. The input is terminated by enf of file (EOF).
輸入含有若干行字串。每個字串單獨在一行,有 C 個字元,1 ≤ C ≤ 30 。輸入以 EOF 作為結束。
Output
For each expression you should print the corresponding phone number.
對於每個字串,請輸出相對應的電話號碼。
Sample Input 1
1-HOME-SWEET-HOME
MY-MISERABLE-JOB
Sample Output 1
1-4663-79338-4663
69-647372253-562
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
int main(){
char c[100]; int temp ;int a;
while(scanf("%c",c) != EOF){
for(int i=0;i<strlen(c);i++){
if(isalpha(c[i])){
if(c[i]-'A'==0||c[i]-'B'==0||c[i]-'C'==0){
printf("2");
}
if(c[i]-'D'==0||c[i]-'E'==0||c[i]-'F'==0){
printf("3");
}
if(c[i]-'G'==0||c[i]-'H'==0||c[i]-'I'==0){
printf("4");
}
if(c[i]-'J'==0||c[i]-'K'==0||c[i]-'L'==0){
printf("5");
}
if(c[i]-'M'==0||c[i]-'N'==0||c[i]-'O'==0){
printf("6");
}
if(c[i]-'P'==0||c[i]-'Q'==0||c[i]-'R'==0||c[i]-'S'==0){
printf("7");
}
if(c[i]-'T'==0||c[i]-'U'==0||c[i]-'V'==0){
printf("8");
}
if(c[i]-'W'==0||c[i]-'X'==0||c[i]-'Y'==0||c[i]-'Z'==0){
printf("9");
}
}else{
printf("%c",c[i]);
}
}
}
return 0;
}