10
十二月
C程式設計:練習九樣板
49選6大樂透是從01~49中任選6個不重複號碼進行投注。
請寫一個程式產生一次最多可以有5注的投注單來。
/*LottoGen:產生大樂透彩單*/ #include <stdio.h> #include <stdlib.h> #include <time.h> void LottoNumGen(int List[]); int main( int argc, char *argv[ ]) { int i,j, nStakeNum=1; int NumList[6]; if (argc>=2) { nStakeNum=atoi(argv[1]); if (nStakeNum<=0||nStakeNum>5) { printf("1~5 stakes one time\n"); return; } } srand( (unsigned)time( NULL ) ); for (i=0; i<nStakeNum; i++) { LottoNumGen(NumList); for (j=0; j< 6; j++) printf("%2d ", NumList[j]); printf("\n"); } return 0; } void LottoNumGen(int List[]) { /*在以下寫程式*/ /*寫到這裡*/ }
This entry was posted
on 星期四, 十二月 10th, 2009 at 05:34:03 and is filed under 98(上)C程式設計.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
autonavigator@tenfold.prepubescent” rel=”nofollow”>.…
ñïñ!!…
tieck@tents.unaided” rel=”nofollow”>.…
tnx for info!…
anaesthesia@moderating.skorich” rel=”nofollow”>.…
hello!!…
arkabutla@masterpieces.demonstrations” rel=”nofollow”>.…
áëàãîäàðñòâóþ!!…
guttered@ashore.europes” rel=”nofollow”>.…
ñïàñèáî!…
soignee@dwelling.blomdahl” rel=”nofollow”>.…
áëàãîäàðþ….
overestimation@adair.poussins” rel=”nofollow”>.…
ñïàñèáî!…
billowed@incorruptibility.treaties” rel=”nofollow”>.…
ñïñ!…
few@splendidly.thinness” rel=”nofollow”>.…
thank you!!…