Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
146296 任艺宸 判断素数 C++ Accepted 0 MS 268 KB 521 2026-01-28 10:40:40

Tests(25/25):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() bool z(int n) { if(n<2)return false; for(int i=2;i<=sqrt(n);i++){ if(n%i==0)return false; } return true; } using namespace std; int main(){ int n; cin>>n; if(z(n)){ cout<<"Yes"<<endl; }else{ cout<<"No"<<endl; } return 0; }