Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C by sacrimate ( 15 years ago )
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define r " .,!?:;-(){}"
int main()
{ char text[50], *ptr, *rev;
int f;
do {
puts("Vvedite stroku");
gets(text);
}
while ( text == " " );
ptr = (char *)calloc( 50, sizeof ( char ) );
rev = (char *)calloc( 50, sizeof ( char ) );
ptr = strtok( text,r );
strcpy ( rev, ptr );
strrev( rev );
f = strcmp ( ptr, rev );
if (!f) puts( ptr );
ptr = strtok( NULL ,r );
while ( ptr ) {
strcpy ( rev, ptr );
strrev( rev );
f = strcmp ( ptr, rev );
if (!f) puts( ptr );
ptr = strtok( NULL ,r );
}
}
Revise this Paste
Parent: 29637