建立一个项目 程序 。定义一个表示时间的 结构体,有表示年、月、日、小时、分、秒的成员,可以使用 类型short;在主程序中实现输入 输出。
```#include
using namespace std;
struct Time{
short year, month, day, hour, minute, second;
};
void main(){
Time time;
cout << "Please enter the time : ";
cin >> time.year >> time.month >> time.day >> time.hour >> time.minute >> time.second;
cout << "The time is " << time.year << "年" << time.month << "月" << time.day << "日"
<< time.hour << "时" << time.minute << "分" << time.second << "秒";
return ;
}
这样为什么是错的