Varianta 26 / Subiectul 2 / Problema 5 |
#include<iostream.h> void main() {int n,i,j,max,gasit=0; long p; int a[10][10]; cin>>n; for(i=1;i<=n;i++) for(j=1;j<=n;j++) cin>>a[i][j]; for(j=1;j<=n;j++) { p=1; max=0; for(i=1;i<=n;i++) {p=p*a[i][j]; if(a[i][j]>max) max=a[i][j]; } if (p/max==max) { cout<<max<<" "; gasit=1; } } if(!gasit) cout<<"nu exista"; } |