正在加载图片...
float sqrt(-d)/(2*a); cout<<"x1+x2=<<p<< +<<q<<i<<endl; cout<<xl-x2="<<p<<-"<<q<<i<<end 3用一个头文件作为第2题各文件互连的接口 //head. h #include <iostream. h> #include <math.h> void gz float, float, float) id eg(float, float); void xg(float, float, float); lc.cpp #include hea. h void main( ∥ cl.cpp #include h. h' void gz( float a, float b, float d) ∥2.cpp #include head.h" void eg(float a, float b) ∥c3cpp #include head. h void eg(float a, float b) 4用条件编译命令编写一程序,当“# define ff存在时,计算的是圆柱体表面 积;当“# define ff不存在时,计算的是圆锥体表面积 #include <iostream. h> #include <math.h> #define pl3. 1415926 #define ff no cout<<r? cout<< h=?float q=sqrt(-d)/(2*a); cout<<"x1+x2="<<p<<"+"<<q<<"i"<<endl; cout<<"x1-x2="<<p<<"-"<<q<<"i"<<endl; } ⒊用一个头文件作为第 2 题各文件互连的接口。 //head.h #include <iostream.h> #include <math.h> void gz(float,float,float); void eg(float,float); void xg(float,float,float); //c.cpp #include "hea.h" void main() { … } //c1.cpp #include "h.h" void gz(float a,float b,float d) { … } //c2.cpp #include "head.h" void eg(float a,float b) { … } //c3.cpp #include "head.h" void eg(float a,float b) { … } ⒋用条件编译命令编写一程序,当“#define FF”存在时,计算的是圆柱体表面 积;当“#define FF”不存在时,计算的是圆锥体表面积。 #include <iostream.h> #include <math.h> #define PI 3.1415926 #define FF void main() { long r,h; cout<<"r=?"; cin>>r; cout<<"h=?";
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有