Advertisement
Polnochniy

Untitled

Jan 22nd, 2020
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <iostream>
  2. #include <time.h>
  3. using namespace std;
  4. const int N = 4;
  5. const int P = 3;
  6. int main()
  7. {
  8. int a[N][P];
  9. int k[P][N];
  10. int transport;
  11. setlocale(LC_ALL, "Rus");
  12. srand(time(NULL));
  13. cout << " Найтие транспортировку матрицы " << endl;
  14. cout << "Вывод элементов" << endl;
  15. for (int i = 0; i < N; i++)
  16. {
  17. for (int j = 0; j < P; j++)
  18. {
  19. a[i][j] = rand() % 12;
  20. cout << a[i][j] << " ";
  21. }
  22. cout << endl;
  23. }
  24. cout << "Транспорт равен" << endl;
  25. for (int i = 0; i < P; i++)
  26. {
  27. for (int j = 0; j < N; j++)
  28. {
  29. k[i][j] = a[j][i];
  30. cout << k[i][j] << " ";
  31. }
  32. cout << endl;
  33. }
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement