4.8

来源:互联网 发布:域名要实名认证吗 编辑:程序博客网 时间:2024/06/06 03:43
#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;}


0 0