D.实验4_3_回文数
#include<stdio.h>
int main() {
int a, b;
scanf("%d",&a);
b=a;
int i=0,k=1,d,e,g=10;
while (b!=0){
b=b/10;
i++;
}
for (int j = 1; j <= i; j++) {
k=k*10;
}
int fl=1;
int za=a,zs=a;
k=k/10;
for (int j = 1; j <= i; j++) {
d=za/k;
za=za-k*d;
k=k/10;
e=zs%g;
zs=zs/10;
if (e!=d){
fl=0;
break;
}
}
if (fl==0){
printf("No");
}if (fl==1){
printf("Yes");
}
return 0;
}