题解 | #Problem A#
Problem A
https://www.nowcoder.com/practice/ee083fda4b39446d9aa543b1039475b8
#include <iostream> using namespace std; /*bool isFullnum (int n){ int sum = 0; for (int i = 1; i < n; i++){ if (n % i == 0){ sum += i; } } return sum == n; } int main () { int a, b; while (cin >> a >> b){ for (int i = a; i <= b; i++){ if (isFullnum(i)){ cout << i << endl; } } } return 0; }*/ int arr[4] = {6, 28, 496, 8128}; int main () { int a, b; while (cin >> a >> b){ for (int i = 0; i < 4; i++){ if (arr[i] >= a && arr[i] <= b){ cout << arr[i] << endl; } } } return 0; }