Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include<stdio.h>
  2. int main(){
  3. char st[80], invst[80];
  4. int linha, tam, i, j, x, y, fim=0, ini=0;
  5.  
  6. scanf("%d ", &linha);
  7.  
  8. for(i=0 ; i<linha ; i++){
  9. fim=0;
  10. fgets(st , 80 , stdin);
  11. for(j=0 ; (st[j]!='\n') && (st[j]!='\0') ; j++){
  12. if((st[j]=='!') || (st[j]=='?') || (st[j]=='.') || (st[j]==' ') || (st[j]==',')){
  13. invst[j] = st[j];
  14. for(y=j-1 ; y>=ini ; y--){
  15. invst[fim]=st[y];
  16. fim++;
  17. }
  18. fim=j+1;
  19. }
  20. }
  21.  
  22.  
  23. printf("%s", invst);
  24. }
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement