Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. int main()
  7. {
  8. cout << "Ilosc kolumn" << endl;
  9. int y;
  10. cin >> y;
  11. cout <<"Ilosc wierszy"<<endl;
  12. int x;
  13. cin>>x;
  14. double tab[x][y];
  15. cout << "Wypelnij tablice od lewej do prawej"<< endl;
  16. for (int i=0;i<x;i++)
  17. {
  18. for (int z=0;z<y;z++)
  19. {
  20. cout << "Podaj " << i+1 << " kolumna " << z+1 << " wiersz" << endl;
  21. cin >> tab[i][z];
  22. }
  23. }
  24.  
  25. int i=0;
  26. int z=0;
  27. do
  28. {
  29. cout << tab[z][i] << " ";
  30. i++;
  31. if (i==y)
  32. {
  33. cout << tab[i][y] << endl;
  34. i=0;
  35. z++;
  36. }
  37. }
  38. while (i<y&&z<x);
  39.  
  40.  
  41.  
  42.  
  43. return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement