原创 第一題

#include <iostream> using namespace std; class Complex  {public:    Comple

原创 第一章

7,求2個或3個正整數的最大數,用帶有參數的函數實現。 #include <iostream> using namespace std; int main() { int max(int a , int b,int c=0); int a

原创 第十一題

#include <iostream> using namespace std; class Time; class Date  {public:    Date(int,int,int);    friend Time; private

原创 第十二題

#include <iostream> using namespace std; template<class numtype> class Com

原创 第二題

#include <iostream> using namespace std; class Complex  {public:    Comple

原创 第三題

#include <iostream.h>        class Complex  {public:    Complex(){real=0;i

原创 第四題

#include <iostream> using namespace std; class Matrix                                          //定義Matrix類  {public: Ma

原创 第四題

#include <iostream> using namespace std; class Student  {public:    Studen

原创 第九題

#include<string> #include <iostream> using namespace std; class Teacher  {public:    Teacher(string na

原创 第八題

#include <iostream> using namespace std; class A  {   public:    A(){cout<<"constructing A "<<endl;}  

原创 第六題

#include <iostream> #include <strstream> using namespace std; struct student {int num;  char name[20];

原创 第十題

#include <iostream> #include <cstring> using namespace std; class Teacher                            

原创 第五題

#include <iostream> #include <fstream> using namespace std; struct staff {int num;  char name[20];  int age;  double  p

原创 第一題

#include <iostream> using namespace std; class Student {public:   void get_value()    {cin>>num>>name>

原创 第三題

#include <iostream> using namespace std; class Student                        //聲明基類 {public: