杭电oj2010 水仙花数

xiaoxiao2021-03-01  103

#include<iostream> using namespace std; int main() { int m,n,count=0; while(cin>>m>>n) { if(m>n) { int temp; temp=n; n=m; m=temp; } if(m>=100 && m<=n && n<=999) { for(int i=m;i<=n;i++) { if(i==(i/100)*(i/100)*(i/100)+(i/10)*(i/10)*(i/10)+(i)*(i)*(i)) { if(i!=n) { cout<<i<<" "; count=1; } else { cout<<i<<endl; count=1; } } } if(count==0) { cout<<"no"<<endl; } else { //cout<<endl; count=0; } } else break; } return 0; }

心态爆炸 一直弹出来输出格式不对。

转载请注明原文地址: https://www.6miu.com/read-3650305.html

最新回复(0)