Files
NJUST-OJ/2010.cpp
2018-08-01 02:30:29 +08:00

34 lines
972 B
C++

#include <iostream>
using namespace std;
int main(){
// 1K以内的所有水仙花: 153、370、371、407
int a,b;
while (cin >>a>>b){
if(b<153 || a>407 || (a>153&&b<370)||(a>371&&b<407)){
cout <<"no" << endl;
} else if(a<=153){
if(b>=407)
cout << "153 370 371 407" <<endl;
else if(b>=371)
cout << "153 370 371" <<endl;
else if(b>=370)
cout << "153 370" <<endl;
else
cout << "153" << endl;
} else if(a<=370){
if(b>=407)
cout << "370 371 407" <<endl;
else if(b>=371)
cout << "370 371" << endl;
else
cout << "370" << endl;
} else if(a<=371){
if(b>=407)
cout << "371 407" << endl;
else
cout << "371" << endl;
} else
cout << "407" << endl;
}
}