![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++习题答案
TreasureLX
Programming is an art.
展开
-
第八章习题汇总
1.#include #include using namespace std;double q(double,double,double);int main(){double a,b,c,p,x1,x2; cout<<"please enter a,b,c:"; cin>>a>>b>>c; p=-b/(2*a); try {x1=p+q(a,b,c); x2=p-原创 2015-06-16 17:14:05 · 326 阅读 · 0 评论 -
第一章习题汇总
7.#includeusing namespace std;int main (){int a,b;int f(int x,int y,int z=0);a=f(5,9);b=f(1,5,10);cout<<a<<endl<<b<<endl;return 0;}int f(int a,int b,int c=0){if(b>a) a=b;if(c>a) a=c;re原创 2015-04-12 13:53:06 · 247 阅读 · 0 评论 -
第二章习题汇总
2.[cpp] view plaincopy#include using namespace std; class Time { private: int hour; int minute; int sec; public: void set_time()原创 2015-04-12 14:18:28 · 267 阅读 · 0 评论 -
第七章习题汇总
1.#include#include using namespace std;int main(){ while(1) { double a,b,c,s,area; cin>>a>>b>>c; if(a+b>c&&b+c>a&&c+a>b) { s=(a+b+c)/2; area=sqrt(s*(s-a)*(s-b)*(s-c));原创 2015-06-09 21:41:30 · 285 阅读 · 0 评论 -
第六章习题汇总
1.#include using namespace std; #include "cylinder.h"#include "point.cpp"#include "circle.cpp"#include "cylinder.cpp"int main(){Cylinder cy1(3.5,6.4,5.2,10); cout<<"\noriginal原创 2015-06-02 19:01:08 · 283 阅读 · 0 评论 -
第五章习题汇总
1.#include using namespace std;class Student{public: void get_value() { cin>>num>>name>>sex; } void display( ) { cout<<"num: "<<num<<endl; cout<<"name: "<<name<<endl;原创 2015-05-19 17:03:38 · 349 阅读 · 0 评论 -
第四章习题汇总
1.#include using namespace std;class complex{ public: complex(){real=0;imag=0;} complex(double r,double i) { real=r;imag=i; } void disaplay(); double real; double imag;};voi原创 2015-05-05 12:37:37 · 311 阅读 · 0 评论 -
第三章习题汇总
4.#include using namespace std; class stu{ private: int num; int s; public: stu(int h,int w) { num=h; s=w; } void disaplay(); };void stu::disaplay(){ cout<<num<<" "<<s<<" "原创 2015-04-21 18:51:55 · 353 阅读 · 0 评论 -
C++类的思维导图
原创 2015-04-20 23:15:38 · 772 阅读 · 0 评论