Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. int rows = 3;
  2. int cols = 3;
  3. float **arr = new float* [rows];
  4. for (int i = 0; i < rows; i++)
  5. arr[i] = new float[cols];
  6. cout << "TASK 16\nВведите по " << cols << " элемента(ов) в каждой строке\n";
  7. for (int i = 0; i < rows; i++) {
  8. cout << "строка: " << i + 1 << " из " << rows << endl;
  9. for (int j = 0 ; j < cols; j++)
  10. cin >> arr[i][j];
  11. }
  12. for (int i = 0; i < rows; i++) {
  13. for (int j = 0 ; j < cols; j++)
  14. cout << arr[i][j] << ' ';
  15. cout << endl;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement