Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
7761 | 赖梓乐 | 判断质数(使用while循环) | C++ | Wrong Answer | 0 MS | 264 KB | 560 | 2025-05-17 19:44:51 |
#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(){ //,从2开始到根号n int n,i=1; bool f=true; cin>>i; while(i<=n/i){ if(n%i==0){ //cout<<"No"; f=false ; break; } i++; } if(f) cout<<"Yes"; else{ cout<<"No"; } return 0; }
------Input------
560
------Answer-----
No
------Your output-----
Yes