#include <bits/stdc++.h> int main() { int a; std::cin>>a; for (int i = 6; i <= a; i++) { int sum = 0; for (int j = 1; j <= i - 1; j++)if (i % j == 0)sum += j; if (sum == i) std::cout<<i; } }
@root举报
https://www.codem.org/
有多个答案没写换行
共 4 条回复
@root举报
https://www.codem.org/
有多个答案没写换行