"Algorithm notes" learning record 001

Creative Commons License Copyright: Attribution, allow others to create paper-based, and must distribute paper (based on the original license agreement with the same license Creative Commons )

First, today SLP

p1 ~ 13

第1章如何使用本书
如何高效做题
看一节书做一节题
第2章C/C++快速入门
头文件+主函数
2.1基本数据类型
2.1基本数据类型
2.1.1变量的定义
2.1.2变量类型4种
2.1.3强制类型转换
2.1.4符号常量和const常量
2.1.5运算符
又叫
2.1.2变量的定义
1.整型
2.浮点型
推荐使用double型
3.字符型
1.字符变量和字符常量
2.转义字符
3.字符串常量
4.布尔bool型
2.1.4符号常量和const常量
1.符号常量
宏定义/宏替换
2.const常量
推荐使用

Remarks:

  1. int type: less than 10 ^ 9; 32-bit integer.
  2. long long: less than 10 ^ 18; 64-bit integer.
  3. Big 32 than lowercase letters uppercase letters ASCII code.
  4. Character constants - must be a single character.
  5. Character constants in single quotation marks, and double quotation mark string constants.
  6. String constants can only be assigned to an array of characters, the character can not be assigned to a variable. (C language, C ++ has string type)
  7. % .1f-- one decimal output.
  8. Symbolic constants and const are constants defined constants of the two methods.
  9. The end of the macro definition does not add a semicolon.

Second, today's code analysis

2.01

#include <stdio.h>
int main(){
	int a,b;
	scanf("%d%d",&a,&b);
	printf("%d",a+b);
	return 0;
}

Thinking:

	scanf("%d%d",&a,&b);

Proper operation: put a space becomes% d% d
wrong operation: adding a comma become% d,% d (can not give you the opportunity to enter the second parameter)

Third, the experience of reading

This book is useful structural expression, he said clearly wanted to read on.

Guess you like

Origin blog.csdn.net/kingloveccc/article/details/94356605