求水仙花数#include#includemain(){int x,y;int n,z,m;int temp,index;int counter;while(scanf("%d%d",&x,&y)!=EOF){if(x==0&&y==0){break;}else{if(x>y){temp=x;x=y;y=temp;}index=0;for(n=x;n
来源:学生作业帮助网 编辑:六六作业网 时间:2025/01/12 16:29:39
求水仙花数#include#includemain(){int x,y;int n,z,m;int temp,index;int counter;while(scanf("%d%d",&x,&y)!=EOF){if(x==0&&y==0){break;}else{if(x>y){temp=x;x=y;y=temp;}index=0;for(n=x;n
求水仙花数
#include
#include
main()
{
int x,y;
int n,z,m;
int temp,index;
int counter;
while(scanf("%d%d",&x,&y)!=EOF){
if(x==0&&y==0){
break;
}
else{
if(x>y){
temp=x;
x=y;
y=temp;
}
index=0;
for(n=x;n
求水仙花数#include#includemain(){int x,y;int n,z,m;int temp,index;int counter;while(scanf("%d%d",&x,&y)!=EOF){if(x==0&&y==0){break;}else{if(x>y){temp=x;x=y;y=temp;}index=0;for(n=x;n
这是哪个OJ上的题啊?
表示看不懂你的算法.数据范围这么小,暴力就可以了.
#include
bool check(int x)
{
int tmp=x,sum=0;
while(tmp)
{
int d=tmp%10;
tmp/=10;
sum+=d*d*d;
}
return sum==x;
}
int main()
{
int m,n;
while(scanf("%d%d",&m,&n)!=EOF)
{
int cnt=0;
int array[1000];
for(int i=m;i