重新学习编程的第四天
#include<iostream>
#include<string>
using namespace std;
namespace China {
float population = 14.1;
std::string capital = "北京";
}
namespace Japan {
float population = 1.27;
std::string capital = "东京";
}
int main(void)
{
cout << "中国" << endl;
cout << "首都:" << China::capital << endl;
cout << "人口:" << China::population << endl;
cout << "日本" << endl;
cout << "首都:" << Japan::capital << endl;
cout << "人口:" << Japan::population << endl;
system("pause");
return 0;
}
学习命名空间
挺有趣的哈哈