Advertisement
Guest User

Untitled

a guest
Jan 18th, 2011
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.22 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<string.h>
  4.  
  5. void shift_string (char* str) {
  6.  
  7. int i=0;
  8.  
  9. while(str[i]!='\0'){
  10.  
  11. int contador=0;
  12.  
  13.     if (str[i] =='a')
  14.     str[i] = 'b';
  15.       if (str[i] =='A')
  16.       str[i] = 'B';
  17.         if (str[i] =='b')
  18.         str[i] = 'c';
  19.          if (str[i] =='C')
  20.          str[i] = 'C';
  21.           if (str[i] =='d')
  22.           str[i] = 'e';
  23.             if (str[i] =='D')
  24.             str[i] = 'E';
  25.               if (str[i] =='e')
  26.               str[i] = 'f';
  27.                if (str[i] =='E')
  28.                str[i] = 'F';
  29.                  if (str[i] ='g')
  30.                  str[i] = 'h';
  31.                    if (str[i] =='G')
  32.                    str[i] = 'H';
  33.                      if (str[i] =='i')
  34.                      str[i] = 'j';
  35.                        if (str[i] =='I')
  36.                        str[i] = 'J';
  37.                          if (str[i] =='k')
  38.                          str[i] = 'l';
  39.                            if (str[i] =='K')
  40.                            str[i] = 'L';      
  41. }
  42. }
  43.  
  44. int main(void){
  45. char frase[100];
  46. char c;
  47. printf("digite uma frase:\n");
  48. scanf("%c",&frase);
  49.  
  50. printf("A string modificada eh: %c\n",shift_string(frase));
  51. system("pause");
  52. return 0;
  53.  
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement