隨機(jī)函數(shù)個數(shù)怎么編程?
intnumber[max]={0};inti;srand((unsigned)time(null));/*播種子*/for(i=0;i<max;i++){number[i]=rand()%8+5;/*產(chǎn)生5-12以內(nèi)的隨機(jī)整數(shù)*/printf("%d,",number[i]);}printf("\n");
隨機(jī)函數(shù)個數(shù)怎么編程?
intnumber[max]={0};inti;srand((unsigned)time(null));/*播種子*/for(i=0;i<max;i++){number[i]=rand()%8+5;/*產(chǎn)生5-12以內(nèi)的隨機(jī)整數(shù)*/printf("%d,",number[i]);}printf("\n");