文章
79
粉丝
221
获赞
46
访问
198.2k
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 2, sum = 1; i < n; i++, sum = 1) {
for (int j = 2; j < i; j++)
if (i % j == 0)
sum += j;
if (sum == i) {
cout << i << " its fastors are 1 ";
for (int j = 2; j < i; j++)
if (i % j == 0)
cout << j << " ";
cout << endl;
}
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发