Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
110844 任紫谦 判断质数(使用while循环) C++ Accepted 1 MS 272 KB 277 2025-02-23 14:37:43

Tests(10/10):


Code:

#include <iostream> using namespace std; int main(){ int a=2,n,c=0; cin>>n; while(a<n){ if(n%a==0){ c=1; break; } a++; } if(c==0){ cout<<"Yes"; }else{ cout<<"No"; } }