Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
92862 | Kevin | 素数判断 | C++ | Accepted | 1 MS | 260 KB | 265 | 2024-10-06 16:11:57 |
#include<bits/stdc++.h> using namespace std; bool ss(int n){ for(int i=2;i<=sqrt(n);i++){ if(n%i==0) return false; } return true; } int main(){ int n; cin>>n; if(ss(n)) cout<<"prime"<<endl; else cout<<"not prime"<<endl; return 0; }