fork download
  1. #include <stdio.h>
  2.  
  3. int check(int n) {
  4. for (int x = 2; x < n; x++) {
  5. if (n % x == 0) {
  6. return 0;
  7. }
  8. }
  9. return 1;
  10. }
  11.  
  12. int main(void) {
  13. int a;
  14. scanf("%d", &a);
  15.  
  16. for (int x = 2; x < a; x++) {
  17. int c = a - x;
  18.  
  19. if (check(x) && check(c)) {
  20. printf("%d + %d = %d\n", x, c, a);
  21. break;
  22. }
  23. }
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0.16s 5312KB
stdin
Standard input is empty
stdout
Standard output is empty