Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<string.h>
- void shift_string (char* str) {
- int i=0;
- while(str[i]!='\0'){
- int contador=0;
- if (str[i] =='a')
- str[i] = 'b';
- if (str[i] =='A')
- str[i] = 'B';
- if (str[i] =='b')
- str[i] = 'c';
- if (str[i] =='C')
- str[i] = 'C';
- if (str[i] =='d')
- str[i] = 'e';
- if (str[i] =='D')
- str[i] = 'E';
- if (str[i] =='e')
- str[i] = 'f';
- if (str[i] =='E')
- str[i] = 'F';
- if (str[i] ='g')
- str[i] = 'h';
- if (str[i] =='G')
- str[i] = 'H';
- if (str[i] =='i')
- str[i] = 'j';
- if (str[i] =='I')
- str[i] = 'J';
- if (str[i] =='k')
- str[i] = 'l';
- if (str[i] =='K')
- str[i] = 'L';
- }
- }
- int main(void){
- char frase[100];
- char c;
- printf("digite uma frase:\n");
- scanf("%c",&frase);
- printf("A string modificada eh: %c\n",shift_string(frase));
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement