Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
314371 | tc2424李宛罄 | GESP:2023-6月等级2-T1-找素数 | C++ | Accepted | 100 | 0 MS | 276 KB | 275 | 2024-12-12 22:06:25 |
#include<bits/stdc++.h> using namespace std; int a,b,cnt; int main() { cin>>a>>b; for(int i=a;i<=b;i++){ bool s=true; for(int j=2;j*j<=i;j++){ if(i%j==0){ s=false; break; } } if(s==true){ cnt++; } } cout<<cnt; return 0; }