Cum fac cca intr o matrice patratica sa schimb aceste valori intre ele? De ex
#include
#include

using namespace std;

int main(){
int a[100][100] = { {3,5,8,2},{11,14,6,7},{4,7,12,51},{13,86,35,72} }, l = 4, c = 4, i, j;
for (i = 0; i < l; i++) {
for(j = 0; j < c; j++){
if (a[i][j] == a[j][i])
cout << setw(3) << a[j][i]<<" ";
cout << endl;
}
}

}
aici e codul meu dar e gresit
More Questions From This User See All

Smile Life

Show life that you have a thousand reasons to smile

Get in touch

© Copyright 2024 DOKU.TIPS - All rights reserved.