Varianta 68 / Subiectul 2 / Problema 5 |
#include<fstream.h> int main () {int a [30][30],i,j,n,m,p=1,g=0; cin>>n; cin>>m; for (i=1;i<=n;i++) for (j=1;j<=m;j++) cin>>a[i][j]; for (i=1;i<=n;i++) for (j=1;j<=m;j++) if (a[i][j]>0 && i%2==0 && j%2!=0) { p=p*a[i][j]%10; g=1; } if(g) cout<<p; else cout<<"nu exista"; return 0; } |