#include<iostream>
using namespace std;
//写一程序,输入月份,输出该月英文名,使用指针数组
int main()
{
const char* month[] = { "January","February","March","April","May","June","July","August","September","October","November","December" };
int n;
cout << "请输入月份:";
cin >> n;
if (n >= 1 && n <= 12)
cout << "这是" << *(month + n - 1) << endl;
else cout << "输入错误!" << endl;
return 0;
}
谭浩强c++第三版6-18
最新推荐文章于 2021-09-04 16:52:31 发布