fork download
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4.  
  5. int main()
  6. {
  7. std::srand( std::time(nullptr) ) ;
  8.  
  9. for( int i = 0 ; i < 5 ; ++i ) // 5 lines
  10. {
  11. for( int j = 0 ; j < 7 ; ++j ) // write 7 random digits per line
  12. std::cout << std::rand() % 10 << ' ' ;
  13.  
  14. std::cout << '\n' ; // and end with a new line
  15. }
  16. }
  17.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
7 1 4 0 9 8 2 
7 2 2 2 5 2 8 
4 8 7 4 4 0 2 
1 2 8 9 3 7 9 
7 2 3 6 4 7 9