标签:回文数
#include <stdio.h> int is_palindromic(int num) { char _old = num; char _new = 0; while (num) { _new = _new * 10 + (num % 10); num = num / 10; } if (_new == _old) { return 1; } else { return 0; } } int main() { int num = 0; scanf("%d", &num); int ret = is_palindromic(num); if (ret == 1) { printf("%d 是回文数\n", num); } else { printf("%d 不是回文数\n", num); } system("pause"); return 0; }
标签:回文数
原文地址:http://10706198.blog.51cto.com/10696198/1712613