AC上万那!其实THIS题不难,简直拿定

魈凯KBS  •  5个月前


include<bits/stdc++.h>

using namespace std; int wsnd(int n){

int i,s = 0; for(i = 1;i <= n / 2;i++){

if(n % i == 0){
	s = s + i;
}

} return s; } int main(){

int i; for(i = 1;i <= 1000;i++){

if(wsnd(i) == i){
	cout<<i<<endl;
}

} }


评论: