1、我们可以使用输入输出流来改变数字的输出形式:
Code
编译运行后的结果如下:a number in decimal: 15
in octal: 17
in hex: f
a floating-pint number: 3.14159
non-printing char (escape):
in octal: 17
in hex: f
a floating-pint number: 3.14159
non-printing char (escape):
note:
Œ、浮点数的格式由编译器自动确定。
、通过显式类型转换,任何字符都能转换成char类型,发送到数据流。
2、字符数组的拼接:
3、读取输入数据
note:
Œ、cin通常是指从控制台输入。
、和cin一起使用的输入输出操作符是“>>”。这个操作符接受与参数类型相同的输入。



cout
浙公网安备 33010602011771号