编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第4章编程练习7

#include <iostream>
using namespace std;
struct Pizza
{
 char company[50];
 float diameter;
 float weight;
};
int main()
{
 Pizza piz;
 cout<<"Enter the company name: ";
 cin.getline(piz.company,50);
 cout<<"The name of pizza company is: "<<piz.company<<endl;
 cout<<"Enter the diameter of the pizza: ";
 cin>>piz.diameter;
 cout<<"The diameter of its pizza is: "<<piz.diameter<<endl;
 cout<<"Enter the weight of pizza is: ";
 cin>>piz.weight;
 cout<<"The weight of its pizza is: "<<piz.weight<<endl;
 system("pause");
 return 0;
}

posted @ 2013-11-20 15:54  编程的爬行者  阅读(98)  评论(0编辑  收藏  举报