Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #nclude <math.h>
- #define C 4
- struct MinParams {
- int min;
- int min_abs;
- }
- MinParams get_min_params(int M1[C][C], int M2[C][C]) {
- MinParams result;
- result.min = M1[0][0];
- for(int i = 0; i < C; i++) {
- for(int j = 0; j < C; j++) {
- if (M1[i][j] < result.min)
- result.min = M1[i][j];
- if (M2[i][j] < result.min)
- result.min = M2[i][j];
- }
- }
- result.min_abs = abs(result.min);
- return result;
- }
Add Comment
Please, Sign In to add comment