| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 158334 | 谭鑫哲 | 判断质数(使用while循环) | C++ | Wrong Answer | 1 MS | 272 KB | 504 | 2026-08-21 09:48:48 |
#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 a,b=2; bool f=true; cin>>a; while(b<=a){ if(a%b==0){ f=false; break; } b++; } if(f){ cout<<"Yes"; } else{ cout<<"No"; } return 0; }
------Input------
157
------Answer-----
Yes
------Your output-----
No