fork download
  1. // Online C compiler to run C program online
  2. #include <stdio.h>
  3.  
  4. int main() {
  5. int n;
  6. scanf ("%d", &n);
  7. int x[n], y[n], z[n];
  8. int i;
  9. for (int i = 0; i < n; i++) {
  10. scanf("%d%d%d",&x[i],&y[i],&z[i]);
  11. }
  12.  
  13. int xsum, ysum, zsum;
  14. for(i = 0; i < n; i++) {
  15. xsum = xsum + x[i];
  16. ysum = ysum + y[i];
  17. zsum = zsum + z[i];
  18. }
  19.  
  20. // debug stuff
  21. printf("\n");
  22. printf("%d \n", n);
  23.  
  24. for (int i = 0; i < n; i++) {
  25. printf("\n");
  26. printf("%d ", x[i]);
  27. }
  28. printf("\n");
  29. for (int i = 0; i < n; i++) {
  30. printf("\n");
  31. printf("%d ", y[i]);
  32. }
  33. printf("\n");
  34. for (int i = 0; i < n; i++) {
  35. printf("\n");
  36. printf("%d ", z[i]);
  37. }
  38. printf("\n");
  39. printf("\n%d", xsum);
  40. printf("\n%d", ysum);
  41. printf("\n%d", zsum);
  42.  
  43. return 0;
  44. }
Success #stdin #stdout 0.01s 5284KB
stdin
45
stdout
45 

0 
0 
-1901349148 
32767 
-1901348840 
32767 
-733174848 
21862 
1402808896 
5376 
1402808896 
5376 
-1901349280 
32767 
-1901349264 
32767 
1403071168 
5376 
0 
0 
0 
0 
0 
0 
-1 
0 
0 
0 
-1901075760 
32767 
1403070256 
5376 
0 
0 
0 
0 
-1901342775 
32767 
0 
0 
0 
0 
0 
0 
0 

1402582087 
5376 
26577600 
0 
-1901349104 
32767 
-1901076080 
32767 
2 
32767 
-1901349264 
32767 
3 
0 
-1901349280 
32767 
-1901075760 
32767 
0 
0 
11 
32767 
1096438784 
-1484043609 
1 
0 
0 
0 
-733175088 
21862 
-1901348864 
32767 
0 
0 
0 
0 
-1901349088 
32767 
1401224363 
5376 
8 
48 
-1901349184 
32767 
-1901349376 

41 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
16 
0 
836864994 
8186230 
0 
0 
-8 
-1 
1403068816 
5376 
1402987912 
5376 
-1901349136 
32767 
1402906308 
5376 
0 
0 
0 
0 
0 
0 
1402933710 
5376 
1403070256 
5376 
0 
0 
0 
0 
-1901076024 
32767 
-1901075712 

2060949236
-1115149245
-2138357480