#include
#include
using namespace std;
int f();
int main()
{
srand((unsigned)time(0));
int heads=0,tails=0;
for(int i=0;i
幫忙寫個(gè)C++的Code,是英語題.
幫忙寫個(gè)C++的Code,是英語題.
Write a program that simulates coin tossing. For each toss of the coin, the program should print Heads or Tails. Let the program toss the coin 100 times and count the numberof times each side of the coin appears. Print the results. The program should call a separate function flip that takes no arguments and returns 0 for tails and 1 for heads. [Note: If the program realistically simulates the coin tossing, then each side of the coin should appear approximately half the time.]
寫一個(gè)程序,模擬擲硬幣.對(duì)于每一個(gè)硬幣的折騰,程序應(yīng)該打印頭或尾.讓程序拋硬幣100次計(jì)數(shù)numberof次出現(xiàn)每個(gè)硬幣的一面.打印結(jié)果.該程序應(yīng)調(diào)用不帶任何參數(shù),并返回0的尾巴和1頭一個(gè)單獨(dú)的函數(shù)翻轉(zhuǎn). [注意:如果該程序切實(shí)模擬擲硬幣,那么每個(gè)硬幣的一面應(yīng)出現(xiàn)約一半的時(shí)間.
這個(gè)是工具翻譯的,大概這個(gè)意思,高手幫忙寫個(gè)code啊~~~謝謝
Write a program that simulates coin tossing. For each toss of the coin, the program should print Heads or Tails. Let the program toss the coin 100 times and count the numberof times each side of the coin appears. Print the results. The program should call a separate function flip that takes no arguments and returns 0 for tails and 1 for heads. [Note: If the program realistically simulates the coin tossing, then each side of the coin should appear approximately half the time.]
寫一個(gè)程序,模擬擲硬幣.對(duì)于每一個(gè)硬幣的折騰,程序應(yīng)該打印頭或尾.讓程序拋硬幣100次計(jì)數(shù)numberof次出現(xiàn)每個(gè)硬幣的一面.打印結(jié)果.該程序應(yīng)調(diào)用不帶任何參數(shù),并返回0的尾巴和1頭一個(gè)單獨(dú)的函數(shù)翻轉(zhuǎn). [注意:如果該程序切實(shí)模擬擲硬幣,那么每個(gè)硬幣的一面應(yīng)出現(xiàn)約一半的時(shí)間.
這個(gè)是工具翻譯的,大概這個(gè)意思,高手幫忙寫個(gè)code啊~~~謝謝
其他人氣:166 ℃時(shí)間:2020-05-21 21:09:42
優(yōu)質(zhì)解答
我來回答
類似推薦
- 英語IQ題 If FRTZZ is the code for ESSAY what is the code for PAPER
- 有"9v 3w"的燈泡1和"12v 6w"的燈泡2串聯(lián),電路中兩端允許加的最大電壓是多少?每個(gè)燈的電功率?
- 一罐液化氣大約有多少立方?
- 小池古詩的意思
- 一根電線,第一次用去1/3還多2米,第二次用去余下的2/5少3米,最后還剩11米.這根電線長(zhǎng)多少米?
- 原有蘋果21千克,葡萄13千克,這兩種水果被吃掉相同的重量之后,所剩葡萄的重量是所剩蘋果重量的十三之八
- 全班有51人,下課后男生走了4分之1,女生走了3分之1,人數(shù)相等,女生有幾人
- 關(guān)于x的不等式3m-2x2,m的值是什么
- 若丨a-1丨十丨b+2丨=0,求丨b丨-丨a丨的值
- 已知圓C:x^+y^-2x+4y-4=0,是否存在斜率為1的直線L,使L被圓C截得的弦AB為直徑的圓過原點(diǎn)
- through the rain
- 123代表什么意思呢?
猜你喜歡
- 1書非借不能讀也的也怎么解釋
- 2我愛我們的節(jié)日——春節(jié)征文、急需、
- 3GB2828二次抽樣方案什么情況下適用
- 4賓語與表語兩個(gè)如何判斷?
- 5Hello!__is Lin Tao.Could you tell me if __is a history museum in your city?此句怎么寫
- 6四年級(jí)下冊(cè)14課《陳嘉庚辦學(xué)》讀后感.在今天(4月9日)16時(shí)10分發(fā)來.(原文
- 7This is a _____ of my family.
- 8李奶奶家中有一筐雞蛋,2個(gè)2個(gè)的數(shù),3個(gè)3個(gè)的數(shù),5個(gè)5個(gè)的數(shù),都剩余一個(gè),這筐雞蛋至少有多少個(gè)?
- 9如圖所示,長(zhǎng)木板靜止在光滑的水平面上,長(zhǎng)木板的左端固定一個(gè)檔板,檔板上固定一個(gè)長(zhǎng)度為L(zhǎng)的輕質(zhì)彈簧,長(zhǎng)木板與檔板的總質(zhì)量為M,在木板的右端有一質(zhì)量為m的鐵塊.現(xiàn)給鐵塊一個(gè)水平
- 10一些孩子在操場(chǎng)上奔跑 翻譯
- 11一道比較難的集合題謝謝了,
- 12難忘的八個(gè)字 閱讀題答案!