fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int tombola[90], estratto;
  4. int i=0,k;
  5. int giaestratto; // boolean
  6.  
  7. int main(void) {
  8. srand(time(NULL));
  9. do {
  10. giaestratto=0;
  11. estratto = rand()%90+1;
  12. for (k=0; k<i;k++) {
  13. if (estratto == tombola[k])
  14. {
  15. giaestratto=1;
  16. }
  17. }
  18. if (giaestratto==0) {
  19. tombola[i]=estratto;
  20. printf("\t%d",tombola[i]);
  21.  
  22. i++;
  23. }
  24. } while(i<90);
  25. }
  26.  
Success #stdin #stdout 0s 5460KB
stdin
Standard input is empty
stdout
	2	59	28	22	1	45	38	83	15	34	74	14	37	17	36	69	90	35	13	61	21	49	51	55	68	27	8	40	16	9	60	43	31	87	30	52	11	63	88	76	73	39	18	62	48	54	20	77	84	23	3	24	85	46	7	86	4	72	44	33	41	50	79	32	65	26	75	78	70	6	67	29	25	10	58	66	5	80	56	19	42	82	71	47	12	53	89	64	81	57