您的位置:首页 > 编程语言 > C语言/C++

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

2013-11-20 15:54 429 查看
#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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐