Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
4786 柯宇希 判断质数(使用while循环) C++ Accepted 0 MS 260 KB 252 2024-09-16 15:49:41

Tests(10/10):


Code:

#include<iostream> using namespace std; int main(){ int x,i=2; cin>>x; if(x<2) {cout<<"No";return 0;} while(x%i!=0){ i++; } if(i==x){ cout<<"Yes"; } else cout<<"No"; return 0; }