fork download
  1. #include<iostream>
  2. #include<ctime>
  3. #include<cstdlib>
  4. using namespace std;
  5.  
  6. //IL PROGRAMMA SCRIVE UN NUMERO INTERO CASUALE COMPRESO TRA 0 E 9
  7.  
  8. int main()
  9. {
  10. srand(time(NULL)); //INIZIALIZZA LA GENERAZIONE DI VALORI CASUALI
  11. for(int i=1; i<=100; i++)
  12. cout<<rand()%10<<"\t";
  13.  
  14.  
  15.  
  16. //cout<<"RAND_MAX="<<RAND_MAX<<endl;
  17.  
  18. return 0;
  19.  
  20.  
  21. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
9	7	2	8	1	6	8	9	9	8	9	3	7	4	0	0	1	8	5	0	4	1	4	7	0	0	2	4	2	5	4	4	5	8	2	8	4	2	7	4	2	6	9	2	2	2	2	3	0	7	5	6	0	1	3	1	1	5	7	6	2	3	0	7	2	4	5	8	9	4	4	1	2	4	3	4	6	5	9	8	5	6	4	5	8	7	8	9	4	5	5	6	9	7	4	3	2	1	1	1