首页 > 试题广场 >

编写一个C++程序,它使用3个用户定义的函数(包括main(

[问答题]
编写一个C++程序,它使用3个用户定义的函数(包括main( )),并生成下面的输出:
Three blind mice
Three blind mice
See how they run
See how they run
其中一个函数要调用两次,该函数生成前两行;另一个函数也被调用两次,并生成其余的输出。
发表于 2019-03-13 06:44:43 回复(0)
#include <iostream>
using namespace std;

void print1(void)

{
    cout<<"Three blind mice"<<endl;
}


void print2(void)

{
    cout<<"See how they run"<<endl;
}

int main(void)

{
    print1();
    print1();
    print2();
    print2();
        
    return 0;
}



发表于 2019-03-16 22:47:26 回复(0)
#include<iostream> using namespace std; void a() { cout << "Three blind mice" << endl; } void b() { cout << "See how they run" << endl; } int main() { a(); a(); b(); b(); return 0; }</iostream>
发表于 2021-07-21 22:42:35 回复(0)
#include<iostream>
using namespace std;
void print1(void){
    cout<<"Three blind mice"<<endl;
}
void print2(void){
    cout<<"See how they run"<<endl;
}
int main(){
    print1();
    print1();
    print2();
    print2();
    return 0;
}

发表于 2021-03-22 22:29:10 回复(0)
#include <iostream>

using namespace std;

void three()
{
   cout<<"Three blind mice"<<endl;
}

void see()
{
   cout<<"See how they run"<<endl;
}

int main()
{
    void three();
    void three();
    void see();
    void see();
    return 0;
}

发表于 2020-06-24 14:19:49 回复(0)
#include <iostream>
using namespace std;
void print1 () 
{
    cout<<"Three blind mice"<<endl;
}
void print2 () 
{
    cout<<"See how they run"<<endl;
}
int main() 
{
    print1();
    print1();
    print2();
    print2();
}

发表于 2020-03-09 15:08:32 回复(0)
#include <iostream>

void Print1()
{
	std::cout << "Three blind mice" << std::endl;
}

void Print2()
{
	std::cout << "See how they run" << std::endl;	
}

int main()
{
	Print1();
	Print1();
	Print2();
	Print2();
}

发表于 2019-10-31 09:56:19 回复(0)
#include<iostream>
using namespace std;
void function1()
{
 cout<<"Three blind mice"<<endl;
} 
void function2()
{
 cout<<"See how they run"<<endl;
}
int main()
{
 function1();
 function1();
 function2();
 function2();
 return 0;
}

发表于 2019-01-23 18:11:19 回复(0)