| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 68348 | teacher_wang | 绝对素数 | C++ | Accepted | 0 MS | 240 KB | 615 | 2025-09-30 16:48:52 |
#include <bits/stdc++.h> using namespace std; // 判断x是否为质数 bool isPrime(int x) { bool flag = true; // 假设是素数 if(x <= 1) flag = false; for(int i = 2; i <= sqrt(x); i ++) { if(x % i == 0) { return false; } } return true; } int main() { for(int i = 11; i < 100; i ++) { int tmp = 0; int j = i; while(j) { tmp = tmp*10 + (j % 10); j /= 10; } //cout<<"i="<<i<<" "<<tmp<<"tmp"<<endl; if(isPrime(i) && isPrime(tmp)) cout<<i<<endl; } return 0; }