数据类型-sizeof关键字-实型(浮点型)-转义字符

  • sizeof关键字

  • 实型

  1. 有效数字包括小数点以前的数字
  2. float num1 = 3.14 f ;
  3. 默认情况下输出一个小数,小数点后最多显示6位有效数字
  • 转义字符

点击查看代码
#include<iostream>
#include<string>

using namespace std;

//转义字符

int main()
{
	//换行符 \n
	cout << "hello \nworld" << endl;

	//反斜杠 \\ 
	cout << "\\" << endl;

	//水平制表符 \t  作用:可以 整齐输出数据
	cout << "aaa\thelloworld" << endl; 
	cout << "aaaa\thelloworld" << endl;
	cout << "aaaaaa\thelloworld" << endl;

	system("pause");

	return 0;
}

 

posted @ 2021-07-22 17:14  毋纵年华  阅读(290)  评论(0)    收藏  举报