Advertisement
Alx09

Untitled

May 24th, 2022
742
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <stdarg.h>
  4. #include <string.h>
  5.  
  6.  
  7.  
  8. int main(void){
  9.     int i, j, max, min;
  10.     int n = 4, m= 4;
  11.     int v1[][4] = { 1, 2 , 3 , 4, 5,6,7,8, 1,2,3,4,5,6,7,8};
  12.     max = v1[0][0];
  13.     min = v1[n - 1][m - 1];
  14.     for (i = 0; i < n / 2; i++)
  15.         for (j = 0; j < m; j++)
  16.             if (max < v1[i][j]) max = v1[i][j];
  17.     for ( ; i < n ; i++ )
  18.         for (j = 0; j < m; j++)
  19.             if (min > v1[i][j]) min = v1[i][j];
  20.  
  21.     printf("Valoare reducerilor este: %d", max - min);
  22.     scanf("%*c");
  23.     return 0;
  24. }
  25.  
Advertisement
RAW Paste Data Copied
Advertisement