You are viewing a single comment's thread. Return to all comments →
int main() { int t,count=0,i,j,n; char *s=(char *)malloc(10000*sizeof(char)); char *r=(char *)malloc(10000*sizeof(char)); scanf("%d",&t); while(t!=0) { scanf("%s",s); n=strlen(s); j=n-1; for(i=0;i
} for(i=1;i<n;i++) { if(abs(s[i]-s[i-1])!=abs(r[i]-r[i-1])) { count++; break; } } if(count==0) printf("Funny\n"); else printf("Not Funny\n"); t--; } return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Funny String
You are viewing a single comment's thread. Return to all comments →
include
include
include
include
int main() { int t,count=0,i,j,n; char *s=(char *)malloc(10000*sizeof(char)); char *r=(char *)malloc(10000*sizeof(char)); scanf("%d",&t); while(t!=0) { scanf("%s",s); n=strlen(s); j=n-1; for(i=0;i
}