fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int weight[2][3][4], growth[2][3][4], masw[2][3], max_w = 0, max_g = 0, masg[2][3];
  5. for (int i = 0; i < 2; i++) {
  6. for (int j = 0; j < 3; j++) {
  7. for (int k = 0; k < 4; k++) {
  8. if(i == 0 && j == 0 && k == 2) break;
  9. if(i == 0 && j == 1 && k == 3) break;
  10. if(i == 0 && j == 2 && k == 1) break;
  11. if(i == 1 && j == 0 && k == 2) break;
  12.  
  13. puts("Enter the weight of students and their growth");
  14. scanf("The weight = %d the growth = %d\n", &weight[i][j][k], &growth[i][j][k]);
  15. if(weight[i][j][k] > max_w) {
  16. max_w = weight[i][j][k];
  17. masw[i][j] = max_w;
  18. }
  19. if(growth[i][j][k] > max_g) {
  20. max_g = growth[i][j][k];
  21. masg[i][j] = max_g;
  22. }
  23. }
  24. }
  25. }
  26. for (int i = 0; i < 2; i++) {
  27. for (int j = 0; j < 3; j++) {
  28. if(i == 1 && j == 1) break;
  29. printf("Max weight of %d course and %d group = %d\n", i, j, masw[i][j]);
  30. printf("Max growth of %d course and %d group = %d\n", i, j, masg[i][j]);
  31. }
  32. }
  33. puts("FINISH!!!");
  34. return 0;
  35. }
  36.  
Success #stdin #stdout 0s 10320KB
stdin
Standard input is empty
stdout
Enter the weight of students and their growth
Enter the weight of students and their growth
Enter the weight of students and their growth
Enter the weight of students and their growth
Enter the weight of students and their growth
Enter the weight of students and their growth
Enter the weight of students and their growth
Enter the weight of students and their growth
Enter the weight of students and their growth
Enter the weight of students and their growth
Enter the weight of students and their growth
Enter the weight of students and their growth
Enter the weight of students and their growth
Enter the weight of students and their growth
Enter the weight of students and their growth
Enter the weight of students and their growth
Max weight of 0 course and 0 group = 1838453127
Max growth of 0 course and 0 group = 1348734224
Max weight of 0 course and 1 group = 0
Max growth of 0 course and 1 group = 64
Max weight of 0 course and 2 group = 0
Max growth of 0 course and 2 group = 2097152
Max weight of 1 course and 0 group = 0
Max growth of 1 course and 0 group = 0
FINISH!!!