Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- #include<stdlib.h>
- void wordreverse(char xy[]);
- int main()
- {
- while(1)
- {
- char x[9000], xy[9000][30];
- gets(x);
- int i=0, l=strlen(x), w=0, j=0;
- while(i<=l)
- {
- if(x[i]==' '||x[i]=='\0')
- {
- xy[w][j]='\0';
- wordreverse(xy[w]);
- if(i!=l)printf(" ");
- else printf("%c\n\n", '\0');
- w++;
- j=0;
- }
- else
- {
- xy[w][j]=x[i];
- j++;
- }
- i++;
- }
- }
- return 0;
- }
- void wordreverse(char xy[])
- {
- fflush(stdin);
- char x[30];
- int l=strlen(xy)-1, i=0;
- while(l>=0)
- {
- x[i]=xy[l];
- i++;
- l--;
- }
- x[i]='\0';
- printf("%s", x);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement