博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
c++ 2-各变量类型终端、外部输入 code sample
阅读量:3575 次
发布时间:2019-05-20

本文共 683 字,大约阅读时间需要 2 分钟。

#include 
#include
#include
# define c 100using namespace std;int main(){ //整型输入 int a = 0; cout << "请输入整型变量:" << endl; cin >> a; cout << a << "\tsize:" << sizeof(a) << endl; //浮点型输入 double d = 0; cout << "请输入浮点型变量:" << endl; cin >> d; cout << d << "\tsize:" << sizeof(d) << endl; //字符型输入 char ch = 0; cout << "请输入字符型变量:" << endl; cin >> ch; cout << ch << "\tsize:" << sizeof(ch) << endl; //字符串型输入 string str; cout << "请输入字符串型变量:" << endl; cin >> str; cout << str << "\tsize:" << sizeof(str) << endl; //布尔类型输入 bool flag = true; cout << "请输入布尔型变量:" << endl; cin >> flag; cout << flag << "\tsize:" << sizeof(ch) << endl; system("pause"); return EXIT_SUCCESS;}

转载地址:http://buagj.baihongyu.com/

你可能感兴趣的文章
JavaEE MyBatis与Spring的整合——基于mapper接口方式开发(教材学习笔记)
查看>>
Omap138开发板下以uboot2012.04.01为例分析uboot执行(五)
查看>>
Omap138开发板下以uboot2012.04.01为例分析uboot执行(六)
查看>>
Omap138开发板下以uboot2012.04.01为例分析uboot执行(七)
查看>>
Omap138开发板下以uboot2012.04.01为例分析uboot执行(八)
查看>>
Java发送邮件 注册成功发送邮件
查看>>
Mybatis的简单使用(增删改查),解决数据库字段名和实体类映射属性名不一致的问题
查看>>
Mybatis配置log4j文件 分页查询(limit,rowBounds)
查看>>
Mysql利用注解进行开发
查看>>
Mybatis一对多查询,多对一查询
查看>>
Spring配置bean.xml文件的头目录模板
查看>>
代理模式之------动态代理
查看>>
Spring实现AOP的三种方式
查看>>
SpringMVC和Mybatis整合使用的配置文件
查看>>
将字符串 “k:1|k1:2|k2:3|k3:4” 转换成字典{“k”:1,”k1”:2,”k2”:3,”k3”:4}
查看>>
AttributeError: 'tuple' object has no attribute 'decode'
查看>>
node爬虫(牛刀小试)
查看>>
关于vue的seo优化
查看>>
字符串在html中的页面中的换行
查看>>
react父子组件间的通信和传值
查看>>