提交时间:2023-02-23 22:54:01
运行 ID: 10336
#include <iostream> using namespace std; int go(int n){ int prime(int n); int b, c; for (int i = 3; i < n; i++) { if (prime(i) == 1) { b = i; c = n - b; if (prime(c) == 1)break; } } cout << n << '=' << b << '+' << c << endl ; return 0; } int main() { int a; //cin >> a; for (int i = 6; i <= 100; i+= 2 ) go(i); return 0; } int prime(int n) { for (int i = 2; i < n; i++) if (n%i == 0) return 0; return 1; }