#include <iostream>
using namespace std;
const int Size=20;
struct Pizza
{
 char company[Size];
 double diameter;
 double weight;
};
int main()
{
 Pizza *piz=new Pizza;//使用new创建动态结构
 cout<<"What's the diameter of pizza: ";
 cin>>piz->diameter;
 cin.get();//读取下一个字符
 cout<<"What's the name of pizza company: ";
 cin.get(piz->company,Size);
 //cin.get();
 cout<<"What's the weight of pizza: ";
 cin>>piz->weight;
 cout<<"diameter: "<<piz->diameter<<endl;
 cout<<"company: "<<piz->company<<endl;
 cout<<"weight: "<<piz->weight<<endl;
 system("pause");
 return 0;
}

编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第4章编程练习8的更多相关文章

  1. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习9

    #include <iostream> #include <fstream> #include <cstdlib> #include <string> ...

  2. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习8

    #include <iostream> #include <fstream> #include <cstdlib> const int SIZE=20; using ...

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

    #include <iostream> #include <string> #include <cctype> using namespace std; int m ...

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

    #include <iostream> #include <string> using namespace std; const int MSIZE=100; struct j ...

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

    #include <iostream> using namespace std; const double N1=35000; const int N2=15000; const int ...

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

    #include <iostream> using namespace std; const int strsize=30; const int BOPSIZE=5; void showm ...

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

    #include <iostream> using namespace std; void showmenu(void) { cout<<"Please enter ...

  8. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习2

    #include <iostream> #include <cctype> using namespace std; const int MAXSIZE=10; int mai ...

  9. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习1

    #include <iostream>#include <cctype>using namespace std;int main(){ char ch; while((ch=c ...

  10. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第5章编程练习9

    #include <iostream>using namespace std;int main(){ int num; cout<<"Enter number of ...

随机推荐

  1. BZoj 2301 Problem b(容斥定理+莫比乌斯反演)

    2301: [HAOI2011]Problem b Time Limit: 50 Sec  Memory Limit: 256 MB Submit: 7732  Solved: 3750 [Submi ...

  2. 【第一部分】04Leetcode刷题

    一.反转链表 II /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; ...

  3. tp5.0整合七牛云图片上传

    转:https://www.cnblogs.com/adobe-lin/p/7699638.html 这里以上传图片为例 上传其他文件也是大同小异 使用composer安装gmars/tp5-qini ...

  4. 个人笔记本安装多个jdk(jdk1.7,jdk1.8,jdk1.9,jdk10.0)出现的问题

    1.个人笔记本已经安装jdk1.7,jdk1.8,(之前没有在意这个问题).最近想学习jdk10.0,安装以后,环境变量变成了jdk10.0,就是cmd输入命令java -version,显示版本是j ...

  5. mongodb实现自增的方法

    前面操作看菜鸟教程 function getNextSequenceValue(sequenceName){ var sequenceDocument = Counter.findOneAndUpda ...

  6. 解决centos中vsftpd中文乱码

    系统环境 [root@augusite yum.repos.d]# cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) 软件版本 ...

  7. spark学习之路1--用IDEA编写第一个基于java的程序打包,放standalone集群,client和cluster模式上运行

    1,首先确保hadoop和spark已经运行.(如果是基于yarn,hdfs的需要启动hadoop,否则hadoop不需要启动). 2.打开idea,创建maven工程.编辑pom.xml文件.增加d ...

  8. hdu 1043 Eight (八数码问题)【BFS】+【康拓展开】

    <题目链接> 题目大意:给出一个3×3的矩阵(包含1-8数字和一个字母x),经过一些移动格子上的数后得到连续的1-8,最后一格是x,要求最小移动步数. 解题分析:本题用BFS来寻找路径,为 ...

  9. 大数据技术 - 通俗理解MapReduce之WordCount(二)

    上一章我们搭建了分布式的 Hadoop 集群.本章我们介绍 Hadoop 框架中的一个核心模块 - MapReduce.MapReduce 是并行计算模块,顾名思义,它包含两个主要的阶段,map 阶段 ...

  10. Java反射之基础概念

    0.实例准备 package com.blueStarWei.invoke; public class Student { private String name; public Student() ...