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

4.8

2016-01-28 15:05 459 查看
#define  _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;

struct ww_service
{
char name[30];
double diameter;
double weight;
};
int main()
{
ww_service* pizza=new ww_service;
cout << "Enter the diameter of the pizza: ";
cin >> pizza->diameter;
cin.get();//消除输入流中滞留的换行符的影响
cout << "Enter the company of this pizza: ";
cin.getline((*pizza).name, 30);
cout << "Enter the weight of the pizza: ";
cin >> pizza->weight;
cout << "The information of this pizza as follow:\n ";
cout << "Company name is: " << pizza->name << endl;
cout << "The diameter about the pizza is: " << pizza->diameter << " centimeter."<<endl;
cout << "The weight about the pizza is: " << pizza->weight <<" kilogram."<<endl;
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c++