Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
51645 | littletwleve | 绝对素数 | C++ | Accepted | 1 MS | 240 KB | 365 | 2024-09-23 12:55:05 |
#include<bits/stdc++.h> using namespace std; bool pmn(int x){ bool flag=1; if(x==2) flag=1; else{ for(int i=2;i<x;i++){ if(x%i==0) flag=0; } } return flag; } int c(int n){ int ge=n%10; int shi=(n/10)%10; int nw=ge*10+shi; return nw; } int main(){ for(int i=9;i<100;i++){ if(pmn(i)&&pmn(c(i))) cout<<i<<endl; } return 0; }