Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
123078 | 张奕杨 | 超级素数 | C++ | Accepted | 2 MS | 272 KB | 500 | 2025-06-22 19:30:43 |
#include<iostream> #include<cmath> using namespace std; bool cs(int x){ int a=x; bool b=true; while(a){ for(int i=2;i<=sqrt(a);i++){ if(a%i==0){ return false; } } if(a<2){ return false; } a/=10; } return true; } int main(){ int a,m=0;; cin>>a; for(int i=2;i<=a;i++){ if(cs(i)){ m++; } } cout<<m; return 0; }