Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
110849 | 谢佳辰 | 判断质数(使用while循环) | C++ | Accepted | 0 MS | 268 KB | 316 | 2025-02-23 14:38:23 |
#include <bits/stdc++.h> using namespace std; int main(){ int n,i=2; bool c=true; cin>>n; while(i<n){ if(n%i==0){ c=false; break; } i++; } if(c==true){ cout<<"Yes"<<endl; }else{ cout<<"No"<<endl; } }