#1933: The answer of a029 but just give me 10 robux (cheaper than Ethan) but if u don't give me i will report you to the teacher(real) this is the real answer not like ethan his is fake


1753980-3@g.puiching.edu.mo (P5A31蒲雋浠)

School : No School
ID : 2571
IP address : [192.168.120.33]
Last Login :
2025-05-06 20:40:09
a008. 盈虧互補 -- 板橋高中教學題 | From: [192.168.120.33] | Post Date : 2025-04-14 20:51

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;

int sumProperDivisors(int n) {
    if (n == 1) return 0;
    int sum = 1; // 1 is a proper divisor for any n > 1
    int sqrtN = sqrt(n);
    for (int i = 2; i <= sqrtN; ++i) {
        if (n % i == 0) {
            int other = n / i;
            if (i == other) {
                sum += i;
            } else {
                sum += i + other;
            }
        }
    }
    return sum;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    while (cin >> n && n != 0) {
        int sum = sumProperDivisors(n);
        if (sum == n) {
            cout << "=" << n << "\n";
        } else {
            int possibleM = sum;
            if (sumProperDivisors(possibleM) == n && possibleM != n) {
                cout << possibleM << "\n";
            } else {
                cout << "0\n";
            }
        }
    }
    return 0;
}
 
#2041: Re:The answer of a029 but just give me 10 robux (cheaper than Ethan) but if u don't give me i will report you to the teacher(real) this is the real answer not like ethan his is fake


1753924-2@g.puiching.edu.mo (楊允瀧P5A24)

School : No School
ID : 3096
IP address : [192.168.120.33]
Last Login :
2025-05-18 13:17:22
a008. 盈虧互補 -- 板橋高中教學題 | From: [192.168.120.33] | Post Date : 2025-05-09 17:24

本文章已被封鎖!
#2074: Re:The answer of a029 but just give me 10 robux (cheaper than Ethan) but if u don't give me i will report you to the teacher(real) this is the real answer not like ethan his is fake


1753422-4@g.puiching.edu.mo (P5A30廖善衡 :)

School : Pui Ching Middle School
ID : 2950
IP address : [192.168.120.33]
Last Login :
2025-05-07 19:48:30
a008. 盈虧互補 -- 板橋高中教學題 | From: [192.168.120.33] | Post Date : 2025-05-14 10:12

AI


本文章已被封鎖!

 
 
#2080: Re:The answer of a029 but just give me 10 robux (cheaper than Ethan) but if u don't give me i will report you to the teacher(real) this is the real answer not like ethan his is fake


1753924-2@g.puiching.edu.mo (楊允瀧P5A24)

School : No School
ID : 3096
IP address : [192.168.120.33]
Last Login :
2025-05-18 13:17:22
a008. 盈虧互補 -- 板橋高中教學題 | From: [192.168.120.33] | Post Date : 2025-05-16 17:24

AI

 

 
ZeroJudge Forum