#include <iostream>
using namespace std;
struct CandyBar
{
 char kind[20];
 float weight;
 int calory;
};

int main()
{
 CandyBar snack=
 {
  "Mocha Munch",
  2.3,
  350
 };
 cout<<"The kind of snack is: "<<snack.kind<<endl;
 cout<<"The weight of snack is: "<<snack.weight<<endl;
 cout<<"The calory of snack is: "<<snack.calory<<endl;
 system("pause");
 return 0;
}

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

  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. OpenSSL + Windows 下载安装

    Download Win32 OpenSSLhttps://slproweb.com/products/Win32OpenSSL.htmlhttps://wiki.openssl.org/index. ...

  2. DNS解析中的A记录、AAAA记录、CNAME记录、MX记录、NS记录、TXT记录、SRV记录、URL转发等

    AA记录: 将域名指向一个IPv4地址(例如:100.100.100.100),需要增加A记录 NSNS记录: 域名解析服务器记录,如果要将子域名指定某个域名服务器来解析,需要设置NS记录 SOASO ...

  3. MySQL Windows 下的安装

    my.ini ####################配置文件开始################### # For advice on how to change settings please s ...

  4. 【转】Crosswalk入门

    原文:https://www.mobibrw.com/2015/1934 Crosswalk是一款开源的web引擎.目前Crosswalk正式支持的移动操作系统包括Android和Tizen,在And ...

  5. bzoj2870

    题解: 边分治入门题 当然并查集+维护直径更加简单 就是两棵树二合一直径是两颗树上的4个直径两两组合的最大值 查询路径长度你搞个差分查个lca就好了 点分治并不能做这题 分成多个联通块就gg了(点分治 ...

  6. bzoj2683&&bzoj4066

    题解: 前一题不是强制在线,后一题是强制在线 树套树空间会炸 说一下cdq分治+树状数组 首先我们利用cdq分治使得查询和操作保证先后关系 然后矩阵查询变成4个矩阵的差 那么我们就可以运用扫描线的方法 ...

  7. Python题目练习(二)

    1.如何实现对python列表去重,并保持原来顺序 li = [1,2,5,3,1,6,3,8,0,3,2,4] l = [] for i in li: if i not in l: l.append ...

  8. TopCoder SRM502 Div1 500 贪心 01背包

    原文链接https://www.cnblogs.com/zhouzhendong/p/SRM502-500.html SRM502 Div1 500 好题. 首先,如果已经确定了解决所有问题的优先级, ...

  9. ibatis 多种传参方式

    1,在公司项目yuda遇到的传入in语句,如果直接拼接in语句:in (....),sqlmap中使用#...#输出是不行的. 为需要使用: 第三种:in后面的数据确定,使用string传入      ...

  10. LeetCode 234. 回文链表

    class Solution { public: bool isPalindrome(ListNode* head) { deque<int> d1, d2; ListNode* p = ...