#include <iostream> #include <iomanip> #include <cmath> using namespace std; bool symm(unsigned n) { unsigned i=n; unsigned m=0; while(i>0) { m=m*10+i%10; i/=10; } return m==n; } int main() { for(unsigned m=11;m<1000;m++) { if(symm(m)&&symm(m*m)&&symm(m*m*m)) { cout<<"m="<<m; cout<<"m*m="<<m*m; cout<<"m*m*m="<<m*m*m<<endl; } } return 0; }
标签:std,10,unsigned,打卡,include,4.25 From: https://www.cnblogs.com/Sunyiran/p/17353616.html