Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- int i,j,k=0,t,len;
- char str[1000],word[1002];
- scanf("%d",&t);
- while(t--)
- {
- scanf(" %[^\n]",str);
- str[strlen(str)]=' ';
- str[strlen(str)+1]='\0';
- for(i=0; str[i] ; i++)
- {
- if(str[i]!=' ')
- {
- word[k]=str[i];
- k++;
- }
- else{
- while(k>0)
- {
- k--;
- printf("%c",word[k]);
- }
- printf(" ");
- k=0;
- }
- }
- printf("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement