回文数

发布时间 2023-07-08 10:00:49作者: 爱吃泡面的皮卡
#include <iostream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
    system("pause");
    int num,m=0,n;
    cin>>num;
    for(int n=num;n>0;n=n/10){
        m=m*10+n%10;
    }
    if(m==num){
        cout<<"是回文数" <<endl;
    }else{
        cout<<"不是回文数"<<endl;
        }
    return 0;
}