Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
3137 | 邓小龙 | 超级素数 | C++ | Runtime Error | 1996 MS | 256 KB | 465 | 2024-04-06 10:56:23 |
# include<iostream> using namespace std; bool isprime(int x){ if(x<=2||x%2==0) return 0; for(int i=2;i*i<=x;i++){ if(x%i==0) return 0; } return 1; } int main(){ int n,sum=0,temp=0; cin>>n; for(int i=2;i<=n;i++){ while(i>10){ temp=i; if(isprime(temp)==1) break; else temp=temp/10; } if(isprime(temp)==1) sum++; } cout<<sum; return 0; }
Runtime Error:[ERROR] A not allowed system call. Call ID:275