SHARE
TWEET

Untitled

a guest Jun 27th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. Guilherme Salgado Alves
  3. RA:140083
  4. Problema 140083
  5. */
  6. #include <stdio.h>
  7.  
  8. int minmaxi (int *m,int *n, int matriz[100][100], int *minmax,int *linha,int *coluna){
  9. int k,i,min=10000,x;
  10. for (k=0;k<*m;k++){
  11.   for(i=0;i<*n;i++){
  12.     if (matriz[k][i]< min){
  13.       x=k;
  14.      
  15.     }
  16.   }
  17. }
  18. for (i=0;k<*n;i++){
  19.   if(*minmax>matriz[x][i]){
  20.     *minmax=matriz[x][i];
  21.     *linha=x;
  22.     *coluna=i;
  23.   }
  24. }
  25. return 0;
  26. }
  27.  
  28. int main(void) {
  29. int matriz[100][100],m, n, minmax,k,i,linha,coluna;
  30. scanf("%d %d",&m, &n);
  31.   for (k=0;k<m;k++){
  32.     for(i=0;i<n;i++){
  33.     scanf("%d", &matriz[k][i]);
  34.   }
  35. }
  36.  
  37. minmaxi (&m, &n, matriz, &minmax, &linha, &coluna);
  38.   printf("%d %d %d", linha, coluna, minmax);
  39.   return 0;
  40. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top