Files
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

26 lines
450 B
C++

#include<bits/stdc++.h>
using namespace std;
int cnt = 0;
bool isPerNum(int n) {
int sum = 0;
for (int i = 1; i < n; i++)
if (n % i == 0) sum += i;
if (sum == n) {
cnt++;
return true;
} else return false;
}
int main() {
int n;
cin >> n;
for (int i = 1; i < n; i++)
if (isPerNum(i))
cout << i << endl;
cout << "*" << cnt << endl;
return 0;
}