- 博客(14)
- 收藏
- 关注
原创 创建三角形类
#include #include using namespace std;class Shape { public: virtual double getArea() const =0; virtual void print() const =0; virtual ~Shape(){}}; class Circle : public Shape
2015-06-16 20:32:11 376
原创 C++第六章第五题
#include using namespace std;class Shape{public: virtual double area() const =0; };class Circle:public Shape{public:Circle(double r):radius(r){}
2015-06-16 20:17:59 336
原创 C++第六章第四题
#include using namespace std;class Shape{public: virtual double area() const =0; };class Circle:public Shape{public:Circle(double r):radius(r){}
2015-06-16 20:13:16 265
转载 C++第六章第三题
#include using namespace std;class Point{public: Point(float a,float b):x(a),y(b){} virtual ~Point(){cout private: float x; float y;};class Circle:public Point{public:Circl
2015-06-16 20:09:34 294
原创 C++第六章习题第一题
1.#include class Point{public: Point(float x=0,float y=0); void setPoint(float,float); float getX() const {return x;} float getY() const {return y;} friend ostream & operatorprot
2015-06-16 20:03:33 381
原创 C++第七章
include #include using namespace std; int main() { double a,b,c,s,area; cout"please input a,b,c:"; cin>>a>>b>>c; if (a+b cerr"a+b else if(b+c cerr"b+c else if (c
2015-06-08 16:32:51 225
原创 C++第五章
#include "iostream" #include "string" using std::cin; using std::cout; using std::endl; using std::string; class Student { protected: int num; string name;
2015-06-08 16:30:10 254
原创 C++第四章
(1)#include using namespace std; class complex{ public: complex(){real=0;imag=0;} complex(double r,double i){real=r;imag=i;} void display(); do
2015-05-18 16:20:10 226
原创 对字符串进行的操作
#include #include #include class String { public: String(){p=NULL;} String(const String &); String(char *str); ~String(); String & operator=(const String &); String
2015-05-18 16:17:26 347
原创 C++第三章
#include iostream> using namespace std; class Date { public: Date(int=1,int=1,int=2005); void display(); private: int month; int day; int year; }; Date::Date(int m,
2015-04-27 21:18:39 298
原创 C++ 第二章编程题
2.2#includeusing namespace std;class Time{public:void cin_Time(){cin>>hour>>minute>>sec;}void cout_Time(){cout}private:int hour; int minute; int sec; };i
2015-04-14 12:10:34 323
原创 C++ 第一章编程题
1.7 #includeusing namespace std;int main(){int a,b,c;cin>>a>>b;int max(int a,int b,int c=5);coutreturn 0;}int max(int a,int b,int c=5){if(aa=b;if(aa=c;return a;}1.
2015-04-14 09:57:26 292
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人