| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 12250 | 罗炜翰 | 判断质数 | C++ | 通过 | 100 | 1 MS | 256 KB | 343 | 2025-07-09 14:59:44 |
#include<bits/stdc++.h> using namespace std; int fun(int q){ for(int i=2;i<q;i++){ if(q%i==0){ return 0; } } return 1; } int funa(int q){ for(int i=2;i<q;i++){ if(q%i==0){ return i; break; } } } int main() { int n; cin>>n; if(fun(n)){ cout<<"Yes"; } else{ cout<<funa(n); } }