Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
138834 张文浩 判断质数(使用while循环) C++ Time Limit Exceeded 1000 MS 264 KB 219 2025-11-30 11:24:35

Tests(0/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ bool s=1; int i,n=2; cin>>i; while(n<i){ if(i%n==0){ s=0; } } if(s=1){ cout<<"YES"; }else{ cout<<"NO"; } return 0; }