65,210
社区成员
发帖
与我相关
我的任务
分享
namespace PrintThis
{
void PrintThis(const string& s);
}
namespace PrintThat
{
void PrintThat(const string& s);
}
namespace Print
{
void Print(const string& s);
}
#include<iostream>
#include"10-1-1.h"
#include"10-1-2.h"
#include"10-1-3.h"
using PrintThis::PrintThis;
using PrintThat::PrintThat;
using Print::Print;
using namespace std;
void main()
{
PrintThis();
PrintThat();
}
#include"10-1-1.h"
using namespace PrintThis;
void PrintThis(const string& s)
{
using namespace std;
cout<<"Please input the string for PrintThis: ";
cin>>s;
using namespace Print;
Print(s);
}
#include"10-1-2.h"
using namespace PrintThat;
void PrintThat(const string& s)
{
using namespace std;
cout<<"Please input the string for PrintThat: ";
cin>>s;
using namespace Print;
Print(s);
}
#include"10-1-3.h"
using namespace Print;
void Print(const string& s)
{
std::cout<<s<<std::endl;
}
