为什么输出不出来?995!
查看原帖
为什么输出不出来?995!
1355828
MSJ2013楼主2024/8/6 17:40

cout都输出不出来! 必关!

#include<bits/stdc++.h> 
using namespace std;
int main(){
	long long n,i,j,sam=0;
	cin>>n;
	for( i=2;i<=n;i++){
		for( j=1;j<i;j++){
			if(i%j==0){
				sam+=j;	
			}
			
		}
		if(i==sam){
			std::cout<<i<<endl;
		}
	}
	return 0;	
}
2024/8/6 17:40
加载中...