Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
152229 罗钰帆 13判断质数 C++ Accepted 1 MS 268 KB 493 2026-04-23 19:45:47

Tests(10/10):


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() using namespace std; int main(){ int i; int a=0,s=0; cin>>s; for(i=2;i<=sqrt(s);i++){ if(s%i==0){ a=1; } } if(a==1){ cout<<"No"; } else{ cout<<"Yes"; } return 0; }