C++的问题
其他问答
1
#include
#include
#include
using namespace std;
int mian()
{
void print(char *moth[],int y);
char *moth[12]={"January ","February","March","April","May","June","July","August","September","October","November","December"};
cout<<"请输入月份数:"<<endl;
int num;
cin>>num;
cout<<"对应的英语是:"<<endl;
print(moth,(num-1));
_getch();
return 0;
}
void print(char *moth[],int y)
{
cout<<*moth[y]<<endl;
}
为什么无法运行?
-
#include using namespace std; void print(char *moth); int main() { char moth[][10]={"January ", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; cout<<"请输入月份数:"<<endl; int num; cin>>num; cout<<"对应的英语是:"<<endl; print(moth[num-1]); getchar(); return 0; } void print(char *moth) { cout<<moth<<endl; }
发表回复