主題
:
C++問題
查看單個文章
2009-11-21, 09:38 PM
#
6
(
permalink
)
pedrowong
註冊會員
榮譽勳章
勳章總數
2
UID - 312366
在線等級:
註冊日期: 2008-10-25
住址: 台北
文章: 94
精華: 0
現金: 207 金幣
資產: 367 金幣
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
int a,b;
srand( (unsigned)time( NULL ) );
for(a=0;a<=7;a++)
{
b=rand()%42+1;
if(b<=42&&b>=0)
printf("%d\n",b);
}
system("pause");
return 0;
}
送花文章: 4,
收花文章: 84 篇, 收花: 193 次
pedrowong
查看公開訊息
訪問 pedrowong 的個人網站
查尋 pedrowong 發表的更多文章
有 2 位會員向 pedrowong 送花:
magicwoo
(2009-11-22),
rainfire
(2009-11-22)
感謝您發表一篇好文章