这样写可以吗?符合题意吗?感谢回答(结果是正确的
#include <iostream>
using namespace std;
namespace myNum {
int x = 105;
}
using namespace myNum;
int main()
{
cout << x << endl;
if (x % 2 == 0)
cout << "偶数" << endl;
else
cout << "奇数" << endl;
return 0;
}
#include <iostream>
using namespace std;
namespace myNum {
int x = 105;
}
using namespace myNum;
int main()
{
cout << x << endl;
if (x % 2 == 0)
cout << "偶数" << endl;
else
cout << "奇数" << endl;
return 0;
}
2020-03-28
举报