Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include <iostream>
  2. #include <ctime>
  3. #include <cstdlib>
  4. using namespace std;
  5.  
  6. int tab5x5[5][5];
  7.  
  8. int main()
  9. {
  10. srand(time(NULL));
  11. for(int i=0;i<5;i++)
  12. {
  13. for(int j=0;j<5;j++)
  14. {
  15. tab5x5[i][i]=rand() % 100;
  16. }
  17. }
  18. cout<<tab5x5[0][0]<<tab5x5[1][0]<<tab5x5[2][0]<<tab5x5[3][0]<<tab5x5[4][0]<<endl;
  19. cout<<tab5x5[0][1]<<tab5x5[1][1]<<tab5x5[2][1]<<tab5x5[3][1]<<tab5x5[4][1]<<endl;
  20. cout<<tab5x5[0][2]<<tab5x5[1][2]<<tab5x5[2][2]<<tab5x5[3][2]<<tab5x5[4][2]<<endl;
  21. cout<<tab5x5[0][3]<<tab5x5[1][3]<<tab5x5[2][3]<<tab5x5[3][3]<<tab5x5[4][3]<<endl;
  22. cout<<tab5x5[0][4]<<tab5x5[1][4]<<tab5x5[2][4]<<tab5x5[3][4]<<tab5x5[4][4]<<endl;
  23.  
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement