main.cpp 333 B

12345678910111213141516171819202122232425
  1. #include <iostream>
  2. #include <cstdlib>// stdlib.h
  3. #include <ctime>// time.h
  4. using namespace std;
  5. int main()
  6. {
  7. cout << "Hello world!" << endl;
  8. int nb;
  9. srand(time(0));
  10. cout << time(0) << endl << endl;
  11. for (int i(0); i<8; i++)
  12. {
  13. nb = rand() % 5;
  14. cout << nb << endl;
  15. }
  16. return 0;
  17. }