Untitled

mail@pastecode.io avatar
unknown
plain_text
15 days ago
394 B
4
Indexable
Never
#include <stdio.h>

int revenum(int num) {
    int reve = 0;
    while(num > 0) {
        reve = reve * 10 + (num % 10);
        num = num / 10;
    }
    return reve;
}

int main() {
    int a, b, c;
    scanf("%d %d", &a, &c);
    b = revenum(c);
    if (a == b) {
        printf("palindrome\n");
    } else {
        printf("not palindrome\n");
    }

    return 0;
}
Leave a Comment