原创 摩托車繼承自行車和機動車

#include <iostream> #include<conio.h> #include <windows.h> using namespace

原创 實現複數類中的運算符重載

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

原创 實現複數類中的運算符重載2

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

原创 c++小數位 表示

#include <iostream> #include <iomanip> using namespace std; struct WageList {     char name[10];  //姓名

原创 學生成績處理

#include <stdio.h> double average(double a,double b,double c,double d) {double e;e=(a+b+c+d)/4.0;retur

原创 角色一

#include <iostream> using namespace std; class Role { public:         void setRole(string Name,int Blo

原创 多少天

#include<iostream> using namespace std; int main() {int year,month,day;int t=0;cin>>year>>month;if(yea

原创 分數類的雛形

#include <iostream> #include<string> #include<iomanip> using namespace std; int GCD(int n,int m); clas

原创 向量積

#include<stdio.h>  struct zuobiao      {          int x;int y;     };  int main()  {   int  gg;struct

原创 IP地址

#include <iostream> using namespace std; class IP { private:     union     {         unsigned char seg

原创 長方柱類

#include <iostream> using namespace std; class Bulk { public:     Bulk(double l=1,double w=1,double h=

原创 公約數

#include <iostream> using namespace std; int gcd(int x,int y) {    if(x%y==0)     return y;    else  

原创 人數不定的數組類

#include <iostream> using namespace std; class Salary { public:     Salary(int n);     ~Salary();    

原创 求閏年

#include <iostream> using namespace std; struct y_m_d { int year; int month; int day; };

原创 工資讀入數據

#include <iostream> #include<fstream> #include<cstdlib> using namespace std; class Salary { public: