10-19 AC
This commit is contained in:
33
2010.cpp
Normal file
33
2010.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user