Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
57695 zhangzhexuan 判断一个数是否为质数 C++ Accepted 1 MS 248 KB 290 2024-11-26 21:01:11

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main() { int a,f=0; cin>>a; for(int i=2;i*i<=a;i++) { if(a%i==0) { f=1; } } if(f==1) { cout<<"no"; } else { cout<<"yes"; } }


Judgement Protocol: