2025-03-06 22:46:33 +08:00

29 lines
434 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*-------------------------------------------------------
输入一个整数,判断是否为回文数(所谓回文数就是左右对称的数)
使用while循环
-------------------------------------------------------*/
#include <stdio.h>
main()
{
int n,t,s;
s=0;
scanf("%d",&n);
t=n;
/**********Program**********/
while(n){
s*=10;
s+=n%10;
n/=10;
}
/********** End **********/
if( t==s )
printf("yes\n");
else
printf("no\n");
}