麻烦每个问题标个序号对应一下thxdtl hihhxhdxhxo g s j d b n c j sh b d
图一:
1.int
2.double
3.char
4.int
图2:
2.
\n输出结果:
Hello!Welcome to C++ World!Hello!
Welcome to C++ World!Hello!
Welcome to C++ World!
Hello!
Welcome to C++ World!
\t输出结果
Section One Two Three Four
Mon Math English
\0输出结果
hello不确定字符
hello
\\输出结果
c:helloworld itle.txt
c:\hello\world\title.txt
图3:
第3题
输出结果为:-32768
因为short类型的范围是-32768到32767,32768的二进制码是1000 0000 0000 0000,该二进制码是-32768的补码,所以输出结果就是-32768
第4题
4 8
第5题
%.10f 2.7182818280
%.8f 2.71828183
%.8e 2.7182818ee+000
第6题
a= 6.00,b= 6.00,c= 8.00 (注意:=和6之间有3个空格)
area of triangel is 17.88854
第7题的完整代码:
#include <iostream>
#include <iomanip> //第一个空
using namespace std;
int main()
{
double pi; /*第二个空*/ pi=3.1415926;
double radius,area;
cin >> radius;//第三个空
area = pi * radius * radius;
cout << setw(10)<<pi << setw(10) << radius << setw(10) <<area;//第四个空
return 0;
}
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!