Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
327819 黄浙峰老师 【C5-1】判断质数 C++ 通过 100 0 MS 244 KB 277 2025-06-29 10:36:01

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int isP(int x){ if(x==2) return 1; for(int i=2; i*i<=x; i++){ if(x%i==0){ return i; } } return 1; } int main(){ int n; cin>>n; if(isP(n)==1){ cout<<"Yes"; }else{ cout<<isP(n); } return 0; }


测评信息: