迴文3

 avatar
user_3763047219
c_cpp
2 years ago
286 B
2
Indexable
Never
#include <stdio.h>
int main()
{
	int num = 0;
	int num1 = 0;
	int num2 = 0;
	scanf("%d", &num);
	num1 = num;
	for (int i = 0; i < 5; i++) {
		num2 = num2 * 10 + num % 10;
		num = num / 10;
	}
	if (num1 == num2) {
		printf("%d", 1);
	}
	else {
		printf("%d", 0);
	}
}