Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
354398 胡珂 【C2-8】判断素数 C++ 通过 100 1 MS 244 KB 283 2025-10-02 13:53:27

Tests(5/5):


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


测评信息: