C++ 10.27
发布日期:2022-03-16 03:25:45
浏览次数:30
分类:技术文章
本文共 1922 字,大约阅读时间需要 6 分钟。
1、
#include<iostream>
using namespace std; int main() { char ch = 's'; cout << ch << endl; cout << "char所占的内存空间为" << sizeof(char) << endl; cout << (int)ch << endl; system("pause"); return 0; }2、
#include<iostream>
using namespace std; int main() { cout << "hello world\n"; system("pause"); return 0; }#include<iostream>
using namespace std; int main() { cout << "\\"<<endl; system("pause"); return 0; }#include<iostream>
using namespace std; int main() { cout << "ss\tuuu"<<endl; cout << "s\tuuu" << endl; cout << "ssssss\tuuu" << endl; cout << "sssssss\tuuu" << endl; system("pause"); return 0; }3、
#include<iostream>
using namespace std; int main() { char str[] = "qwer"; cout << str << endl; system("pause"); return 0; }#include<iostream>
using namespace std; #include<string> int main() { string str = "qwer"; cout << str << endl; system("pause"); return 0; }4、
#include<iostream>
using namespace std; int main() { bool flag = true; cout << flag << endl; cout << "bool所占用的内存空间为:" << sizeof(bool) << endl; system("pause"); return 0; }5、
#include<iostream>
using namespace std; int main() { int a = 0; cout << "请输入整型a的值:" << endl; cin >> a; cout << "整型a的值:" <<a<< endl; system("pause"); return 0; }#include<iostream>
using namespace std; int main() { float f = 0; cout << "请输入浮点型f的值:" << endl; cin >> f; cout << "浮点型f的值:" <<f<< endl; system("pause"); return 0; }#include<iostream>
using namespace std; int main() { char ch = '0'; cout << "请输入字符型ch的值:" << endl; cin >> ch; cout << "字符型ch的值:" <<ch<< endl; system("pause"); return 0; }#include<iostream>
using namespace std; #include<string> int main() { string str = "0"; cout << "请输入字符串型str的值:" << endl; cin >> str; cout << "字符串型str的值:" <<str<< endl; system("pause"); return 0; }#include<iostream>
using namespace std; int main() { bool flag = true; cout << "请输入布尔型flag的值:" << endl; cin >> flag; cout << "布尔型flag的值:" <<flag<< endl; system("pause"); return 0; }转载地址:https://blog.csdn.net/zhizhikaodigua/article/details/120998907 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
不错!
[***.144.177.141]2024年04月01日 00时01分47秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
LeetCode题解(1184):公交站间的距离(Python)
2019-04-26
LeetCode题解(1422):分割字符串的最大得分(Python)
2019-04-26
LeetCode题解(1436):旅行终点站-寻找循环的终点(Python)
2019-04-26
H5+CSS前端特效源代码:可旋转动态日文片假名
2019-04-26
python程序没有报错但是运行没有任何结果怎么办?
2019-04-26
简单说一说MySQL中drop、delete与truncate的区别?
2019-04-26
InnoDB与MyISAM的区别
2019-04-26
思科 Packet Tracer 实验六 RIP路由协议基本配置
2019-04-26
计算机网络实验七:DHCP基本配置
2019-04-26
计算机网络实验八:思科NAT的基本配置
2019-04-26
三郎数据结构算法学习笔记:单向环形链表约瑟夫问题
2019-04-26
前端特效H5+css+js:动态可拉进度条+附完整源码
2019-04-26
三郎数据结构学习笔记:双向循环链表(判断是否对称)附源码
2019-04-26
三郎数据结构算法学习笔记:基数排序
2019-04-26
三郎数据结构算法学习笔记:斐波那契(黄金分割法)查找算法
2019-04-26
Java中标识符的命名规则是什么?硬性要求和非硬性要求
2019-04-26
Java中八种基本数据类型的大小,以及他们的封装类
2019-04-26
Spring依赖注入的方式有几种,各是什么?
2019-04-26
SpringMVC怎么样设定重定向和转发的?
2019-04-26
SpringMVC常用的注解有哪些?
2019-04-26