Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 years ago
331 B
8
Indexable
Never
#include <stdio.h>
#include <string>
int main() {
	char digit[50];
	scanf("%s", digit);
	int len = strlen(digit);
	bool flag = true;
	for (int i = 0; i < len / 2; i++) {
		if (digit[i] != digit[len - 1 - i]) {
			flag = false;
			break;
		}
	}

	if (flag) {
		printf("%d", 1);
	}
	else {
		printf("%d", 0);
	}
}