#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. KnockoutJs学习笔记(五)

    作为一名初学者来说,一篇篇的按顺序看官网上的文档的确是一件很痛苦的事情,毕竟它的排列也并非是由浅及深的排列,其中的顺序也颇耐人寻味,于是这篇文章我又跳过了Reference部分,进而进入到具体的bin ...

  2. MyBatis - 1.入门

    MyBatis 是支持定制化 SQL.存储过程以及高级映射的优秀的持久层框架. MyBatis 避免了几乎所有的 JDBC 代码和手动设置参数以及获取结果集. MyBatis可以使用简单的XML或注解 ...

  3. 435. Non-overlapping Intervals

    Given a collection of intervals, find the minimum number of intervals you need to remove to make the ...

  4. curl请求https请求

    function curl_https($url,$data){ $ch = curl_init (); curl_setopt ( $ch, CURLOPT_URL, $url ); curl_se ...

  5. element-ui MessageBox的bug

    通过 use引用messageBox有bug Vue.use(MessageBox) 页面一开始会有一个弹窗,内容空白 Vue.component(MessageBox.name, MessageBo ...

  6. Python学习(二十二)—— 前端基础之BOM和DOM

    转载自http://www.cnblogs.com/liwenzhou/p/8011504.html 一.前言 到目前为止,我们已经学过了JavaScript的一些简单的语法.但是这些简单的语法,并没 ...

  7. Codeforces 803G Periodic RMQ Problem 线段树

    Periodic RMQ Problem 动态开点线段树直接搞, 我把它分成两部分, 一部分是原来树上的, 一部分是后来染上去的,两个部分取最小值. 感觉有点难写.. #include<bits ...

  8. Ansible 详解

    原文:https://www.cnblogs.com/keerya/p/7987886.html#_label0,有改动 一.Ansible简介 1.ansible是什么 a.ansible是新出现的 ...

  9. AtCoder Regular Contest 082 (ARC082) E - ConvexScore 计算几何 计数

    原文链接http://www.cnblogs.com/zhouzhendong/p/8934254.html 题目传送门 - ARC082 E 题意 给定二维平面上的$n$个点,定义全集为那$n$个点 ...

  10. Java 异常处理的重要认识

    异常类的继承结构 Exception : 一般标识的是程序中出现的问题,可以直接使用try---catch处理. Error : 一般值得是JVM错误,程序中无法处理. 检测异常类需要在throws后 ...