提交时间:2023-02-23 22:30:50
运行 ID: 10335
#include<bits/stdc++.h> using namespace std; bool is_prime(int x) { for (int i = 2; i * i <= x; i++) { if(x % i == 0) return false; } return true; } int main() { for (int i = 6; i <= 100; i += 2) {//偶数 for (int j = 3; j <= i / 2; j += 2) {//不从2开始 if(is_prime(j)) { int b = i - j; if(is_prime(b)) { cout << i <<"="<< j <<"+"<< b << endl; break; } } } } return 0; }