Advertisement
VitorMDias

uri1845

Aug 24th, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.68 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. #include<math.h>
  4. #include<stdlib.h>
  5.  
  6. int main()
  7. {
  8.     char aux , i , f[8] ={'f' ,'s', 'j', 'b', 'z', 'p', 'v', 'x'} , F[8] = {'F' , 'S' , 'J' , 'B' , 'Z' , 'P' , 'V' , 'X'} ;
  9.     char letra;
  10.     int ant_f = 0;
  11.     int eh_f = 0;
  12.     while(scanf("%c" , &letra) != EOF)
  13.     {
  14.         eh_f = 0;
  15.         for(i = 0; i < 8 ; i++)
  16.         {
  17.             if(letra == f[i]) {
  18.                 letra = 'f';
  19.                 eh_f = 1;
  20.             };
  21.             if(letra == F[i]) {
  22.                 letra = 'F';
  23.                 eh_f = 1;
  24.             };
  25.         }
  26.         if (eh_f == 0)  
  27.             printf("%c" , letra);
  28.         else
  29.         {
  30.             if (ant_f == 0)
  31.                 printf("%c" , letra);  
  32.            
  33.         }
  34.         if (eh_f == 1)
  35.             ant_f = 1;
  36.         else
  37.             ant_f = 0;
  38.        
  39.     }
  40.    
  41.     return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement