Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
105977 | 陈骏睿 | 判断质数(使用while循环) | C++ | Accepted | 1 MS | 272 KB | 479 | 2025-01-15 10:35:20 |
#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 n,m=2; bool f=0; cin>>n; while(n>m){ if(n%m==0){ f=1; break; } m++; } if(f==0){ cout<<"Yes"<<endl; }else{ cout<<"No"<<endl; } return 0; }