SHARE
TWEET

Untitled

a guest Oct 10th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int nr_sa(int a[100][100],int n,int m)
  2. {
  3.     int i,j,nr=0,maxx,minn,k,min1,max1;
  4.     for(i=0;i<n;i++)
  5.     {
  6.      for(j=0;j<m;j++)
  7.     {
  8.         minn = 2147148001;
  9.         maxx = -2147148001;
  10.         min1 = minn;
  11.         max1 = maxx;
  12.         for(k=0;k<m;k++)
  13.         {
  14.             if(a[i][k] > maxx) maxx = a[i][k];
  15.             if(a[i][k] < minn) minn = a[i][k];
  16.         }
  17.         for(k = 0;k<n;k++)
  18.         {
  19.             if(a[k][j]>max1)max1=a[k][j];
  20.         if(a[k][j] < min1) min1 = a[k][j];
  21.     }
  22.         if(a[i][j] == maxx&&a[i][j]==min1) nr++;
  23.         else
  24.         if(a[i][j] == max1&&a[i][j]==minn) nr++;
  25.     }
  26. }
  27.     return nr;
  28. }
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