noshin98

uva 11946-2

Aug 2nd, 2016
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.12 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5.     int t,i,l,j,n=0;
  6.     char s[1000];
  7.     scanf("%d",&t);
  8.     getchar();
  9.     for(i=1;i<=t;i++)
  10.     {
  11.         if(n==1)
  12.             printf("\n");
  13.         n=1;
  14.  
  15.         while(gets(s))
  16.         {
  17.             l=strlen(s);
  18.             if(l==0)
  19.             {
  20.                 break;
  21.             }
  22.  
  23.             for(j=0;j<l;j++)
  24.             {
  25.                 if(s[j]=='0')
  26.                     s[j]='O';
  27.                 else if(s[j]=='1')
  28.                     s[j]='I';
  29.                 else if(s[j]=='2')
  30.                     s[j]='Z';
  31.                 else if(s[j]=='3')
  32.                     s[j]='E';
  33.                 else if(s[j]=='4')
  34.                     s[j]='A';
  35.                 else if(s[j]=='5')
  36.                     s[j]='S';
  37.                 else if(s[j]=='6')
  38.                     s[j]='G';
  39.                 else if(s[j]=='7')
  40.                     s[j]='T';
  41.                 else if(s[j]=='8')
  42.                     s[j]='B';
  43.                 else if(s[j]=='9')
  44.                     s[j]='P';
  45.             }
  46.             puts(s);
  47.         }
  48.  
  49.     }
  50.     return 0;
  51. }
Add Comment
Please, Sign In to add comment