xt6-18.cpp
上传用户:liubin
上传日期:2022-06-13
资源大小:85k
文件大小:0k
源码类别:

书籍源码

开发平台:

Visual C++

  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {char *month_name[13]={"illegal month","January","February","March","April",
  5.    "May","June","July","August","September","October", "November","December"};
  6. int n;
  7. cout<<"input month:"<<endl;
  8. cin>>n;
  9. if ((n<=12) && (n>=1))
  10.    cout<<"It is "<<*(month_name+n)<<endl;
  11. else
  12.   cout<<"It is wrong"<<endl;
  13. return 0;