64,682
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <string>
#include <cstring>
int main()
{
struct pizza{ std::string name; double diameter; double weight; };
pizza* pt = new pizza;
std::cout << "What's the pizza's diameter?";
std::cin >> pt->diameter;
std::cout << "What's the company's name?";
std::cin >> pt->name;
std::cout << "What's the pizza's weight?";
std::cin >> pt->weight;
std::cout << "The pizza's diameter is " << pt->diameter << std::endl;
std::cout << "The company's name is " << pt->name << std::endl;
std::cout << "The pizza's weight is " << pt->weight << std::endl;
getchar();
return 0;
}