[理学]计算机程序设计6.pptVIP

  • 0
  • 0
  • 约1.75万字
  • 约 73页
  • 2018-03-01 发布于浙江
  • 举报
[理学]计算机程序设计6

编码实现 double PlayGame() { int actual_price, lower_price = lowest_price, higher_price = highest_price; int chances_left = guesstimate_count; int bout_count = 0, prevailed_bout_count = 0; while(TRUE) { printf( \n ); actual_price = InitializeBout(); if(PlayBout(actual_price, lower_price, higher_price, chances_left)) prevailed_bout_count++; bout_count++; if(!Again()) break; } return (double)prevailed_bout_count / (double)bout_count; } 编码实现 void PrintGameOverInfo(double prevailed_ratio) { printf(\nprevailed ratio: %.2lf%%.\n, prevailed_ratio * 100);

文档评论(0)

1亿VIP精品文档

相关文档