8. A(N,M)
Matrisaning musbat hadlarini toping va ularni
bir o’lchovli massivga kеtma- kеt joylang.
Natijaviy massivni chop eting.
N≤4
M≤5
#include
#include
#include
#include
using namespace std;
int main()
{ int N, M;
cout << " Matritsaning ustunlar sonini kiriting "; cin >>N;
cout << " Matritsaning satrlar sonini kiriting "; cin >>M;
int A[N][M], B[N+M];
cout << "A[N][M] ikki o'lchamli massiv "<< endl;
srand(time(NULL));
for(int i=0; ifor(int j=0; jA[i][j]=10+rand()%90;
cout <}
cout << endl;
}
cout << endl<
cout << "Bir o'lchamli massiv "<< endl;
int k=0;
for(int i=0; ifor(int j=0; jB[k]=A[i][j];
cout <k++;
}
}
return 0;
}
Do'stlaringiz bilan baham: |