文章
43
粉丝
180
获赞
21
访问
196.2k
#include <iostream>
#include <unordered_map>
using namespace std;
int a, b;
void check(int x)
{
int res = 0;
unordered_map<int, int> h;
for (int i = 1; i <= x / i; i ++ )
if (x % i == 0) h[i] ++, h[x / i] ++;
for (auto p : h) res += p.first;
if (2 * x == res) cout << x << endl;
}
int main()
{
cin >> a >> b;
for (int i = a; i <= b; i ++ ) check(i);
return 0;
}
登录后发布评论
暂无评论,来抢沙发