Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int matrice[50][50],l,c,k,j;
- int main() {
- cout << "Introduceti numarul de linii: ";
- cin >> l;
- cout << "\nIntroduceti numarul de coloane: ";
- cin >> c;
- cout << "\nIntroduceti elementele matricii: ";
- for (int i = 0; i < l; i++) {
- for (int j = 0; j < c; j++) {
- cin >> matrice[i][j];
- }
- }
- for (int i = 0; i < l*c; i++) {
- cout << matrice[i/c][i%c] << " ";
- if ((i + 1) %c == 0 ) {
- cout << endl;
- }
- }
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement