Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
44736 WZH 合数求和 C++ Wrong Answer 0 MS 236 KB 235 2024-04-02 20:59:02

Tests(0/1):


#include<bits/stdc++.h> using namespace std; bool is_comp(int u){ for(int i=2;i<=u;i++){ if(u%i==0) return 1; } return 0; } int main() { int n,m=0; cin>>n; for(int i=4;i<n;i++){ m+=is_comp(i)*i; } cout<<m; }


Judgement Protocol: