cpp4.10
来源:互联网 发布:unity3d 角色行走 编辑:程序博客网 时间:2024/04/29 13:17
4.10
#include<iostream>#include<string>#include<cstring>int main(){using namespace std;char charr[20];string str;cout << "Length of string in charr before input: "<< strlen(charr) << endl;cout << "Length of string in str before input: "<< str.size() << endl;cout << "Enter a line of text:\n";cin.getline(charr, 20);cout << "You entered: " << charr << endl;cout << "Enter another line of text:\n";getline(cin, str);cout << "You entered: " << str << endl;cout << "Length of string in charr after input: "<< strlen(charr) << endl;cout << "Length of string in str after input: "<< str.size() << endl;system("pause");return 0;}
4.11
#include<iostream>struct inflatable{char name[20];float volume;double price;};int main(){using namespace std;inflatable guest ={"Glorious Gloria",1.88,29.99};inflatable pal ={"Audacious Arthur",3.12,32.99};cout << "Expand your guest list with " << guest.name;cout << " and " << pal.name << "!\n";cout << "You can have both for $";cout << guest.price + pal.price << "!\n";system("pause");return 0;}
0 0
- cpp4.10
- 10
- 10
- 10
- 10
- 10
- 10
- 10
- 10
- 10%
- 10
- 10
- 10
- 10
- 10
- 10
- 10
- #10
- 2016.10.27回顾
- Python下opencv使用笔记(三)(图像的几何变换)
- PHP 数组遍历方法大全(foreach,list,each)
- 结构体字节对齐
- Google Material Design的图标字体版本
- cpp4.10
- USB 3.0规范中译本 第2章 术语及缩略语
- MySql中把一个表的数据插入到另一个表中的SQL语句
- 2016ACM/ICPC亚洲区沈阳站-HDU-5948-Thickest Burger(最水的签到题)
- HashMap的实现原理和底层数据结构
- windows内存注入
- Linux命令行总结
- git学习(1)
- 企业技术负责人必须知道的DevOps10个小技巧