Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3080 孙浚轩 超级素数 C++ Accepted 0 MS 268 KB 432 2024-03-30 22:57:36

Tests(10/10):


Code:

#include<iostream> using namespace std; int sps=0; bool isprime(int n){ if(n<=1) return 0; for(int i=2;i<=n/i;i++) if(n%i==0) return 0; return 1; } bool isSuperP(int n){ while(n>0){ if(!isprime(n)) return 0; n/=10; } return 1; } int main(){ int m,n; cin>>n; for(int i=1;i<=n;i++) if(isSuperP(i)) sps++; cout<<sps; return 0; }