#include
#include
using namespace std;
int f();
int main()
{
srand((unsigned)time(0));
int heads=0,tails=0;
for(int i=0;i
帮忙写个C++的Code,是英语题.
帮忙写个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.]
写一个程序,模拟掷硬币.对于每一个硬币的折腾,程序应该打印头或尾.让程序抛硬币100次计数numberof次出现每个硬币的一面.打印结果.该程序应调用不带任何参数,并返回0的尾巴和1头一个单独的函数翻转. [注意:如果该程序切实模拟掷硬币,那么每个硬币的一面应出现约一半的时间.
这个是工具翻译的,大概这个意思,高手帮忙写个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.]
写一个程序,模拟掷硬币.对于每一个硬币的折腾,程序应该打印头或尾.让程序抛硬币100次计数numberof次出现每个硬币的一面.打印结果.该程序应调用不带任何参数,并返回0的尾巴和1头一个单独的函数翻转. [注意:如果该程序切实模拟掷硬币,那么每个硬币的一面应出现约一半的时间.
这个是工具翻译的,大概这个意思,高手帮忙写个code啊~~~谢谢
其他人气:690 ℃时间:2020-05-21 21:09:42
优质解答
我来回答
类似推荐
猜你喜欢
- 1The couplets on the door are very old .please _.A.put them up B take them down
- 2blow your chance
- 3181440/3/4/5/6/7/8=?有没有简便算法?
- 4甲容器中有含盐10%的盐水500克,乙容器中有含盐15%的盐水200克,往两个容器中分别倒入等量的水
- 5解方程换元法x/(x+1)+1=(2x+2)/x
- 6请问,北京,今天----2010年3月20号星期六的天气变化很大吗?
- 7使用温度计前要先看清其量程,再看清其分度值.先要看清楚其量程是为了防止在使用温度计时,因量程过小而造成温度计 .看清楚分度值是为了在读数时能快捷读数.
- 8英语翻译
- 9((10+5x)/25)^2-2((2x+2)/25)=1,x=
- 10什么海树成林.什么海知识广.什么海人最多.什么海常思索.