欢迎来到天天文库
浏览记录
ID:23393872
大小:64.59 KB
页数:80页
时间:2018-11-07
《c++程序设计教程修订版——设计思想与实现习题解答钱能》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、二2.1#includevoidmain(){//本题原考虑在16位机器上实验目前多为32位机器故已过时。inta=42486;cout<#includeconstdoublepi=3.1415926;voidmain(){doubleradius1,radius2;cout<<"pleaseinputtwonumbers:";c
2、in>>radius1>>radius2;cout<#includeconstdoublee=2.718281828;voidmain(){cout<3、flags(ios::fixed)<voidmain(){80cout<<""Howmanystudentshere?""<<""500"";}2.5#includevoidmain(){cout<<"sizeofchar"<4、ar)<<"byte"<<"sizeofsignedchar"<5、sizeoflong"<6、put3sidesofonetriangle:6,6,8a=6.00,b=6.00,c=8.00areaoftriangleis17.888542)该程序计算三角形的面积前后分为三部分输入处理输出。3)//#include#include#include#includevoidmain(){floata,b,c,s,area;//printf("pleaseinput3sidesofonetriangle:");cout<<"pleaseinput3sidesofonetriangl7、e:";80//scanf("%f,%f,%f",&a,&b,&c);//输入时以逗号作为数据间隔cin>>a>>b>>c;//输入时以空格作为数据间隔s=(a+b+c)/2;area=sqrt(s*(s-a)*(s-b)*(s-c));//printf("a=%7.2f,b=%7.2f,c=%7.2f",a,b,c);cout<
3、flags(ios::fixed)<voidmain(){80cout<<""Howmanystudentshere?""<<""500"";}2.5#includevoidmain(){cout<<"sizeofchar"<4、ar)<<"byte"<<"sizeofsignedchar"<5、sizeoflong"<6、put3sidesofonetriangle:6,6,8a=6.00,b=6.00,c=8.00areaoftriangleis17.888542)该程序计算三角形的面积前后分为三部分输入处理输出。3)//#include#include#include#includevoidmain(){floata,b,c,s,area;//printf("pleaseinput3sidesofonetriangle:");cout<<"pleaseinput3sidesofonetriangl7、e:";80//scanf("%f,%f,%f",&a,&b,&c);//输入时以逗号作为数据间隔cin>>a>>b>>c;//输入时以空格作为数据间隔s=(a+b+c)/2;area=sqrt(s*(s-a)*(s-b)*(s-c));//printf("a=%7.2f,b=%7.2f,c=%7.2f",a,b,c);cout<
4、ar)<<"byte"<<"sizeofsignedchar"<5、sizeoflong"<6、put3sidesofonetriangle:6,6,8a=6.00,b=6.00,c=8.00areaoftriangleis17.888542)该程序计算三角形的面积前后分为三部分输入处理输出。3)//#include#include#include#includevoidmain(){floata,b,c,s,area;//printf("pleaseinput3sidesofonetriangle:");cout<<"pleaseinput3sidesofonetriangl7、e:";80//scanf("%f,%f,%f",&a,&b,&c);//输入时以逗号作为数据间隔cin>>a>>b>>c;//输入时以空格作为数据间隔s=(a+b+c)/2;area=sqrt(s*(s-a)*(s-b)*(s-c));//printf("a=%7.2f,b=%7.2f,c=%7.2f",a,b,c);cout<
5、sizeoflong"<6、put3sidesofonetriangle:6,6,8a=6.00,b=6.00,c=8.00areaoftriangleis17.888542)该程序计算三角形的面积前后分为三部分输入处理输出。3)//#include#include#include#includevoidmain(){floata,b,c,s,area;//printf("pleaseinput3sidesofonetriangle:");cout<<"pleaseinput3sidesofonetriangl7、e:";80//scanf("%f,%f,%f",&a,&b,&c);//输入时以逗号作为数据间隔cin>>a>>b>>c;//输入时以空格作为数据间隔s=(a+b+c)/2;area=sqrt(s*(s-a)*(s-b)*(s-c));//printf("a=%7.2f,b=%7.2f,c=%7.2f",a,b,c);cout<
6、put3sidesofonetriangle:6,6,8a=6.00,b=6.00,c=8.00areaoftriangleis17.888542)该程序计算三角形的面积前后分为三部分输入处理输出。3)//#include#include#include#includevoidmain(){floata,b,c,s,area;//printf("pleaseinput3sidesofonetriangle:");cout<<"pleaseinput3sidesofonetriangl
7、e:";80//scanf("%f,%f,%f",&a,&b,&c);//输入时以逗号作为数据间隔cin>>a>>b>>c;//输入时以空格作为数据间隔s=(a+b+c)/2;area=sqrt(s*(s-a)*(s-b)*(s-c));//printf("a=%7.2f,b=%7.2f,c=%7.2f",a,b,c);cout<
此文档下载收益归作者所有