fork download
  1. #include <iostream>
  2. #include <time.h>
  3.  
  4. int main()
  5. {
  6. srand(time(NULL));
  7. int number1, number2;
  8.  
  9. for( int i = 0; i < 20; ++i) {
  10. number1 = rand() % 3;
  11. number2 = rand() % 3;
  12. printf("%i, %i\n", number1, number2);
  13. }
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
0, 0
0, 0
1, 1
1, 0
0, 1
2, 1
2, 1
1, 2
2, 2
0, 0
1, 0
0, 1
1, 2
1, 2
1, 0
1, 0
1, 2
0, 2
0, 0
0, 1