You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include <iostream>
|
|
using namespace std;
|
|
int main() {
|
|
int num = 0,a,b,c;
|
|
cin>>num;
|
|
a=num%10;//个位
|
|
b=num/10%10;//十位
|
|
c=num/100;//百位
|
|
if(a*a*a+b*b*b+c*c*c==num) {
|
|
cout<<num<<"是水仙花数";
|
|
} else {
|
|
cout<<num<<"不是水仙花数";
|
|
}
|
|
}
|