[求助]如何做这个程序?
编写一个C++程序,它使用3个用户定义的函数(包括main()),并生成下面的输出:
Three blind mice
Three blind mice
See how they run
See how they run
其中一个函数要调用两次,该函数生成前两行;另一个函数也被调用两次,并生成其余的输出.
请各位大哥帮帮忙!!
[此贴子已经被作者于2007-5-14 14:01:22编辑过]
编写一个C++程序,它使用3个用户定义的函数(包括main()),并生成下面的输出:
Three blind mice
Three blind mice
See how they run
See how they run
其中一个函数要调用两次,该函数生成前两行;另一个函数也被调用两次,并生成其余的输出.
请各位大哥帮帮忙!!
[此贴子已经被作者于2007-5-14 14:01:22编辑过]
#include<iostream>
using namespace std;
void print1()
{
cout<<"Three blind mice"<<endl;
}
void print2()
{
cout<<"See how they run"<<endl;
}
void main()
{
for(int i=0;i<2;i++)
{
print1();
}
for(i=0;i<2;i++)
{
print2();
}
}
应该是这样了~~~
cin.get();
cin.get();
这个函数也没必要加上去啊~~~
不知道你用什么编译器~~
我用的是VC6.0,
不会出现你说的问题~~~