fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. # define N 1000
  4. #define M 1000000
  5. int main() {
  6. long int i,j,n,m;
  7. long int c[N];
  8. long int sp[M];
  9. long int mps;
  10. mps=-1;
  11. scanf("%ld",&n);
  12.  
  13. m=0;
  14. for (i = 0; i <n-1; i++){
  15. scanf("%ld", &c[i]);
  16.  
  17. j=i+1;
  18.  
  19. while (j< n) {
  20. scanf("%ld", &c[j]);
  21.  
  22. if ((c[i]+c[j])%2==0) {
  23. sp[m]=(c[i]+c[j]);
  24. printf("%ld ",sp[m]);
  25. m=m+1;
  26. }
  27. j++;
  28. }}
  29. for (i= 0; i < m; i++) {
  30. if ( sp[i]>mps) {
  31. mps= sp[i];
  32. }}
  33. printf("%ld \n",mps);
  34. printf("\n ");
  35. system("pause");
  36. return 0;
  37. }
Success #stdin #stdout #stderr 0s 4532KB
stdin
Standard input is empty
stdout
-1 

 
stderr
sh: 1: pause: not found