输入输出¶
cin, cout¶
C++的输入输出
This operator (>>
) applied to an input stream is known as extraction operator. (Extracts and parses characters sequentially from the stream)
This operator (<<
) applied to an output stream is known as insertion operator. (inserts them into the output stream)
scanf, printf¶
C语言的输入输出
格式化输入输出语句
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", a + b);
// 占位符对应关系
int, %d
double, %lf
char, %c
long long, %lld
如果要一次输出多个变量
在双引号里面,就是要输出的格式,占位符与后面的变量一一对应