TLE 0分求助!!!
查看原帖
TLE 0分求助!!!
976976
Qiuxi楼主2023/6/19 20:19
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a=0,l,he=0;
    cin>>l;
    for(int i=2;;i++){
        for(int j=2;j<=floor(sqrt(i));j++){
            if((i%j==0)&&(i!=2)){
                a++;
                he+=i;
                if(he>=l){
                    cout<<he;
                    break;
                }
                cout<<i<<endl;
            }
        }
    }
	return 0;
}
2023/6/19 20:19
加载中...