Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2018
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5.  
  6. {
  7. int tab[5][6];
  8.  
  9. cout<<"przed transpozycja: ";
  10. for(int i=0;i<6;i++)
  11. {
  12. for(int j=0;j<5;j++)
  13. {
  14. tab[i][j] =rand()%10;
  15.  
  16.  
  17.  
  18. cout<<tab[i][j]<<" ";
  19. }
  20. cout<<endl;
  21. }
  22. //transpozycja macierzy
  23. cout<<"Po transpozycji: "<<endl;
  24. for(int i=0;i<5;i++)
  25. {
  26. for(int j=0;j<6;j++)
  27. if( tab[j][i]%2==0 && tab[j][i]!=0)
  28. cout<<tab[j][i]+1<<" ";
  29. else
  30. cout<<"x"<<" ";
  31. cout<<endl;
  32. }
  33.  
  34.  
  35.  
  36.  
  37. system("PAUSE");
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement