摘要:
template<class T> class MyArray{ private: int size; T *data; public: MyArray(int s){ size=s; data=new T[size]; } void sort(){ int i,j,min; T t; for(i= 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; class Time { private: int minute; int hour; public: void set(int h, int m) { minute = m; hour = h; } frie 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; class number { int fz, fm; friend number operator+(number &n1,number &n2); public: number(int a=0,int b=1 阅读全文
摘要:
二、设计思路、 1.先输出前两个月的兔子数,然后进入循环 2.循环中每过一个月都会有新兔子产生,迭代求出当前月份的兔子数 3.求和输出每个月的兔子总数 三、程序流程图 四、代码实现 #include<stdio.h> using namespace std; int main() { long ra 阅读全文
摘要:
class Person { public: virtual void bellRing() {} virtual ~Person(){} }; class Student:public Person { public: void bellRing(){ cout << "I am a studen 阅读全文
摘要:
#include<iostream> #include <string> using namespace std; class Vehicle { protected: string NO;//编号 public: Vehicle(string n){ NO = n; } virtual int f 阅读全文