迴文2

 avatar
user_3763047219
c_cpp
2 years ago
428 B
3
Indexable
Never
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdio.h>
#include<stdbool.h>
#include<assert.h>

int main()
{
	int num = 0;
	int num1 = 0;
	int num2 = 0;
	scanf("%d", &num);
	if (num < 10000 || num >= 100000)
		return false;
	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);
	}
}