Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- int a[100][100],c1,c2,n,i,j,v[100],mini;
- cout<<"n=";cin>>n;
- for (i=0;i<n;i++)
- for (j=0;j<n;j++)
- cin>>a[i][j];
- cout<<"c1=";cin>>c1;
- cout<<"c2=";cin>>c2;
- mini=a[c1][0];
- for (i=1;i<n;i++)
- if (mini>a[c1][i])
- mini=a[c1][i];
- for (i=0;i<n;i++)
- v[i]=abs(mini-a[c2][i]);
- mini=v[0];
- for (j=1;j<n;j++)
- if (mini>v[j])
- mini=v[j];
- cout<<mini;
- return 0;//
- }
Add Comment
Please, Sign In to add comment