Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
114791 | 李禹宸 | 判断素数II | C++ | Accepted | 153 MS | 272 KB | 282 | 2025-03-23 14:40:05 |
#include<bits/stdc++.h> using namespace std; int sum(int a){ int n=0,x=0; for(int i=2;i<=a;i++){ for(int j=2;j<i;j++){ if(i%j==0){ x++; } } if(x==0){ n++; } x=0; } return n; } int main(){ int x; cin>>x; cout<<sum(x); return 0; }