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.  
  10. return 1;
  11. }
  12.  
  13.  
  14.  
  15. int main(void) {
  16. int a;
  17. scanf("%d", &a);
  18.  
  19. for (int x = 2; x < a; x++) {
  20. int c = a - x;
  21.  
  22. if (check(x) && check(c)) {
  23. printf("%d + %d = %d\n", x, c, a);
  24. break;
  25. }
  26. }
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0s 5320KB
stdin
14
stdout
3 + 11 = 14