Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
390805 | 郭绍凡 | GESP:2023-6月等级2-T1-找素数 | C++ | 通过 | 100 | 0 MS | 268 KB | 249 | 2025-03-16 14:54:49 |
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c=0; cin>>a>>b; for(int i=a;i<=b;i++){ int d=1; for(int j=2;j<=sqrt(i);j++){ if(i%j==0){ d=0; break; } } c+=d; } cout<<c<<endl; return 0; }