#54692: c++正解跟思路 (想學再點)


yp11451032@yphs.tp.edu.tw (711-23吳嘉恩)


#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b;
    while(cin>>a){
        for(int i=1;i<a;i++){
            if(a%i==0){     \\篩選因數
                b+=i;         \\直接加
            }
        }
        if(b<a)
            cout<<"虧數"<<endl;
        else if(b==a)
            cout<<"完全數"<<endl;
        else
            cout<<"盈數"<<endl;
        b=0;
    }
}