-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1259.cpp
More file actions
38 lines (33 loc) · 706 Bytes
/
1259.cpp
File metadata and controls
38 lines (33 loc) · 706 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
36
37
38
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
cin.tie(NULL);
ios_base::sync_with_stdio(false);
while(true){
int num, d=0, flag=true;
int* numArr = new int[5];
cin>>num;
if(num==0){
break;
}else{
while(num){
numArr[d] = num%10;
num /= 10;
d++;
}
}
for(int i=0; i<d; i++){
if(numArr[i]!=numArr[d-i-1]){
flag = false;
break;
}
}
if(flag){
cout<<"yes\n";
}else{
cout<<"no\n";
}
delete[] numArr;
}
}