Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
12758 A班-袁誉晏 纯粹素数 C++ 通过 100 1 MS 256 KB 369 2025-08-23 11:09:39

Tests(1/1):


#include<bits/stdc++.h> using namespace std; bool s(int n); int main() { for(int i=1000;i<3000;i++) { if(s(i)&&s(i%1000)&&s(i%100)&&s(i%10)) { cout<<i<<endl; } } return 0; } bool s(int n) { bool r=true; int i; for(i=2;i<=sqrt(n);i++) { if(n%i==0) { r=false; break; } } if(n<=1) { r=false; } return r; }


测评信息: