标签:
题目:
Description
Input
Output
Sample Input
100 120 300 380
Sample Output
no 370 371
代码:
#include<iostream> using namespace std; //bool narcissus(int n) //{ // int a = n / 100, b = n / 10 % 10, c = n % 10; // return a*a*a + b*b*b + c*c*c == a * 100 + b * 10 + c; //} int naricissus[4] = { 153,370,371,407 }; int main() { int m, n; while (cin >> m >> n) { bool b = true; for (int i = 0; i < 4; i++)if (m <= naricissus[i] && naricissus[i] <= n) { if (!b)cout << " "; cout << naricissus[i]; b = false; } if (b)cout << "no"; cout << endl; } return 0; }
标签:
原文地址:http://blog.csdn.net/nameofcsdn/article/details/52278155