题解 | #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;
}

全部评论

相关推荐

喜欢吃蛋糕仰泳鲈鱼是我的神:字节可以找个hr 给你挂了,再放池子捞
点赞 评论 收藏
分享
shtdbb_:还不错,没有让你做了笔试再挂你
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务