#include <iostream>
#include <string>
using namespace std;
int main()
{
struct Pizza
{
char name[20];
float diameter;
float weight;
};
Pizza p1;
cout<<"Please input the Pizza's information: "<<endl;
cout<<"name: ";
cin.getline(p1.name,20);
cout<<"diameter: ";
cin>>p1.diameter;
getchar();
cout<<"p1.weight: ";
cin>>p1.weight;
getchar();
cout<<"The information of the record: "<<endl;
cout<<"name: "<<p1.name<<endl;
cout<<"diameter: "<<p1.diameter<<endl;
cout<<"weight: "<<p1.weight<<endl;
getchar();
return 0;
}
C++Primer Plus第六版答案4.13.7
最新推荐文章于 2024-09-10 00:01:10 发布