Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream.h>
- #include <conio.h>
- void main () {
- int matrice1[100][100], matrice2[100][100], R, C, i, j;
- cout <<"Quante righe devono avere le matrici?"<<endl;
- cin >> R;
- cout <<"Quante colonne devono avere le metrici?"<<endl;
- cin >> C;
- for (i=0;i<R;i++) {
- for (j=0;j<C;j++) {
- cout <<"Inserisci un elemento nella matrice 1."<<endl;
- cin >> matrice1[i][j];
- }
- }
- for (i=0;i<R;i++) {
- for (j=0;j<C;j++) {
- cout <<"Inserisci un elemento nella matrice 2."<<endl;
- cin >> matrice2[i][j];
- }
- }
- for (i=0;i<R;i++) {
- for (j=0;j<C;j++) {
- if (matrice1[i][j]==matrice2[i][j])
- cout <<"L'elemento uguale è "<<matrice1[i][j]<<". L'elemento si trova nella posizione riga: "<<i<<" colonna: "<<j<<endl;
- }
- }
- getch ();
- return;
- }
Add Comment
Please, Sign In to add comment