Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

請問c++的亂數選取:)

0 views
Skip to first unread message

看到許慧欣了

unread,
Apr 15, 2002, 6:05:39 AM4/15/02
to
※ 引述《supper...@redbbs.cc.ntut.edu.tw ( ~飛~ )》之銘言:
> 【 在 ptuhl...@bbs.cs.nthu.edu.tw (愛在瘟疫漫延時) 的大作中提到: 】
> : 請問一下:
> : 我要寫一個1到100的整數隨機選取100次,
> : 程式寫好後, 剩一個錯誤, 可是不知怎麼修改, 還請網友幫忙:)
> : 程式如下:
> 把
> : {*(r+i) = int random(100); -------這裡說" parse error before '[ "
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 改成
> {*(r+i)=rand();
> 就可以嚕!!試試吧!!!
> : cout<<"(r+"<<i<<")="<<*(r+i)<<endl;
> : }
> : return(0);
> : }
初學c++, 不太會寫!!
謝謝你唷!!
--
※ Origin: 楓橋驛站<bbs.cs.nthu.edu.tw> ◆ From: ccsun39.cc.NCTU.edu.tw
0 new messages