1 solutions
-
0
C :
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<ctype.h> char a[101]; int huiWen(int x) { int h=0; int l=x; while(x>0) { h=h*10+x%10; x/=10; } if(l==h) return 1; else return 0; } int main() { gets(a); int b=atoi(a); if(huiWen(b)==1) printf("TRUE"); else printf("FALSE"); return 0; }
Python :
a=input() b=[] c=[] for i in a: b.append(i) i=len(b)-2 while i>=0: c.append(b[i]) i=i-1 c.append('.') if c==b: print('TRUE') else: print("FALSE")
- 1
Information
- ID
- 10836
- Time
- 1000ms
- Memory
- 16MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By