#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int n,m=0,tmp;//一定要将变量m的值赋为0;
cin>>n;
tmp=n;//对tmp的更改不会影响到变量n;
for(int i=0;i<3;i++)
{
m+=pow(tmp%10,3);
tmp/=10;
}
if(m==n)
cout<<m<<endl;
return 0;
}
#include<cmath>
using namespace std;
int main()
{
int n,m=0,tmp;//一定要将变量m的值赋为0;
cin>>n;
tmp=n;//对tmp的更改不会影响到变量n;
for(int i=0;i<3;i++)
{
m+=pow(tmp%10,3);
tmp/=10;
}
if(m==n)
cout<<m<<endl;
return 0;
}

被折叠的 条评论
为什么被折叠?



