Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ctype.h>
- #include <stdio.h>
- #include <conio.h>
- #include <string.h>
- main ()
- {
- char a[80],c;
- int b[10],n,i=0,k=1,f,v,m,j;
- puts("Upisite recenicu");
- gets(a);
- n=strlen(a)-1;
- //trazi lokaciju razmaka,s tim da je zadnja lokacije zadnje slovo stringa
- for (i=1;i<=n;i++)
- {
- if (isspace(a[i]))
- {b[k]=i;
- b[k+1]=n;
- f=k+1;
- k++;
- }
- }
- //ispisuje od predzadnjeg do zadnjeg,preprezadnjeg do predzadnjeg itd
- for (m=0;m<f;m++)
- {
- for(v=b[f-m-1];v<=b[f-m];v++)
- {c=a[v];
- putchar(c);
- }
- }
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement