#include<stdlib.h>
#include<iostream>
using namespace std;
namespace A
{
int x = 1;
void fun()
{
cout << "A" << endl;
}
}
namespace B
{
int x = 2;
void fun()
{
cout << "b"<< endl;
}
void fun2()
{
cout << "2B" << endl;
}
}
int main(void)
{
cout << A::x << endl;
cout << B::x << endl;
B::fun();
B::fun2();
cout << "hello" << endl;
system("pause");
return 0;
}
运行结果: