Advertisement
Guest User

Ввод и вывод двумерный дин массив

a guest
Dec 4th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <cmath>
  2. #include <iostream>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. int main(){
  8. // ввод
  9. int n;
  10. cin >> n;
  11. int **a = new int*[n];
  12. for (int i = 0; i < n; i++){
  13. a[i] = new int[n];
  14. for (int j = 0; j < n; j++){
  15. cin >> a[i][j];
  16. }
  17. }
  18. // тело программы
  19.  
  20.  
  21.  
  22. // вывод массива
  23. for (int i = 0; i < n; i++){
  24. for (int j = 0; j < n ; j++){
  25. cout << a[i][j] << ' ';
  26. }
  27. cout << endl;
  28. }
  29. system("pause");
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement