33,311
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <string>
using namespace std;
struct car
{
string name;
int year;
};
void main()
{
car* cr = new car[1];
string sr;
cout<<"Names:";
getline(cin,cr[0].name);
cout<<"Year:";
cin>>cr[0].year;
cout<<cr[0].name<<" "<<cr[0].year<<endl;
cin.get();
cin.get();
}