站内搜索: 请输入搜索关键词

当前页面: JAVA 编程资料牛鼻论坛Java & J2SE 技术区→java 编程问题,帮忙解决一下,谢谢!

java 编程问题,帮忙解决一下,谢谢!

发表新主题   回复此主题

第1楼 2007-04-09 19:01 fzdeney 写道:

java 编程问题,帮忙解决一下,谢谢!


In the game of craps, a pass line bet proceeds as follows. Two six-sided dice are rolled; the first roll of the dice in a craps round is called the “come out roll”. A come out roll of 7 or 11 automatically wins, and a come out roll of 2,3,or 12 automatically loses. If 4,5,6,8,9,or 10 is rolled on the come out roll, that number becomes the point. The player keeps rolling the dice until either 7 or the point is rolled. If the point is rolled first, then the player wins the bet. If a 7 is rolled first, then the player loses.
Write a program that simulates a game of craps using these rules without human input. Instead of asking for a wager, the program should calculate whether the player would win or lose. The program should simulate rolling the two dice and calculate the sum. Add a loop so that the program plays 10,000 games \. Add counters that count how many times the player wins, and how many times the player loses. At the end of the 10,000 games, computer the probability of winning [i.e.,Wins/(Wins+Losses)] and output this value. Over the long run, who is going to win the most games, you or the house?

第2楼 2013-08-31 12:44 Robot :

java 编程问题,帮忙解决一下,谢谢! 相关


第3楼 2007-04-10 12:52 写道:

你的问题应该到专业网站去问!

祝好运~


第4楼 2007-04-10 13:47 jun.jans 写道:

I'll win the game~~

As for the reason,just calculate on your computer~!

完了~~


第5楼 2007-07-22 16:10 jaywanghong 写道:

回复: java 编程问题,帮忙解决一下,谢谢!

你还不如把代码写出来才好改

发表新主题   回复此主题