forked from seeditsolution/cprogram
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunnystring
More file actions
35 lines (32 loc) · 664 Bytes
/
Funnystring
File metadata and controls
35 lines (32 loc) · 664 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
int q,i,len;
char str[10000],r[10000];
scanf("%d",&q);
while(q!=0)
{
scanf("%s",str);
len=strlen(str);
for (i = 0; i < len; i++)
{
r[i] = str[strlen(str) - i - 1];
}
int flag=1;
for (i = 1; i < len; i++)
{
if (abs(r[i] - r[i-1]) != abs(str[i] - str[i-1]))
{
printf("Not Funny\n");
flag=0;
break;
}
}
if (flag==1)
printf("Funny\n");
q--;
}
return 0;
}