Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
93981 林嘉乐 判断质数(使用while循环) C++ Accepted 1 MS 272 KB 299 2024-10-19 16:56:02

Tests(10/10):


Code:

#include<iostream> #include<iomanip> using namespace std; int main(){ int n,i; bool a=true; i=2; cin>>n; while(i<n){ if(n%i==0){ a=false;break; } i++; } if(a){ cout<<"Yes"<<endl; } else{ cout<<"No"<<endl; } return 0; }