Advertisement
SMASIF

10921-Find The Telephone

Apr 28th, 2015
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.87 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main ()
  4. {
  5.     char a;
  6.     while(scanf("%c",&a)==1){
  7.             if(a=='A' || a=='B'|| a=='C')
  8.                 printf("2");
  9.             else if(a=='D' || a=='E'|| a=='F')
  10.                 printf("3");
  11.             else if(a=='G' || a=='H'|| a=='I')
  12.                 printf("4");
  13.             else if(a=='J' || a=='K'|| a=='L')
  14.                 printf("5");
  15.             else if(a=='M' || a=='N'|| a=='O')
  16.                 printf("6");
  17.             else if(a=='P' || a=='Q'|| a=='R' || a=='S')
  18.                 printf("7");
  19.             else if(a=='T' || a=='U'|| a=='V')
  20.                 printf("8");
  21.             else if(a=='W' || a=='X'|| a=='Y' || a=='Z')
  22.                 printf("9");
  23.             else if (a=='1')
  24.                 printf("1");
  25.             else
  26.                 printf("%c",a);
  27.  
  28.         }
  29.          return 0;
  30.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement