1樓:雷震八方
"teacher.h"
#ifndef class_teacher
#define class_teacher
#include
#include
#include
using namespace std;
/* 所有教師的父類
class teacher
;//count為課時的數目
private:
int salary;//固定工資,預設為整數
int count;//課時數目
int assistance;//課時補助,預設為整數
string name;
};#endif
"professor.h"
#ifndef class_professor
#define class_professor
#include "teacher.h"
#include
#include
#include
/* 教授類
class professor:public teacher
;#endif
"instructor.h"
#ifndef class_instructor
#define class_instructor
#include
#include
#include
using namespace std;
/* 講師類
class instructor
;#endif
"associateprofessor.h"
#ifndef class_associateprofessor
#define class_associateprofessor
#include
#include
#include
using namespace std;
/* 副教授類
class associateprofessor
;#endif
"teacher.cpp"
#include "teacher.h"
teacher::teacher()
teacher::teacher(string name)
teacher::teacher(int salary,int assistance,string name)
void teacher::setassistancecount(int count)
int teacher::getcount()
"professor.cpp"
#include "professor.h"
professor::professor()
professor::professor(string name)
int professor::sum(int count)
void professor::setassistancecount(int count)
int professor::getcount()
"instructor.cpp"
#include "instructor.h"
instructor::instructor()
instructor::instructor(string name)
int instructor::sum(int count)
void instructor::setassistancecount(int count)
int instructor::getcount()
"associateprofessor.cpp"
#include "associateprofessor.h"
associateprofessor::associateprofessor()
associateprofessor::associateprofessor(string name)
int associateprofessor::sum(int count)
void associateprofessor::setassistancecount(int count)
int associateprofessor::getcount()
"testing.cpp"
#include "associateprofessor.h"
#include "instructor.h"
#include "professor.h"
#include "teacher.h"
void main()
不知道是否符合要求,(都已經除錯通過)
執行環境:visual c++ 6.0
作業系統:xp
你要想要源**,可給我發
e_mail:[email protected]
2樓:彌寄牽暢然
b.aa1=a1;是錯的
c++程式設計題
3樓:匿名使用者
#include
#include
using namespace std;
struct student
s[7];
int main()
for(int i=0;i<5;i++)}
4樓:苦中作樂香蕉
#include
using namespace std;
const int n=5;
int ma***x;
double cunt=0;
struct student
friend istream &operator >>(istream &i,student &k)
} stu[n+1];
int main() {
for(int i=1; i<=n; i++)cin>>stu[i];
cout<<"平均分:"<
急求一道c++程式設計題!!!
5樓:gta小雞
return sum/n;}
c語言程式設計題。程式設計題目為 程式設計計算
include define n 10 定義符號常量 求出每一項階乘值的函式 int fact int n int main include int main printf d n s 輸出結果 return 0 include float factorial int n return produc...
c語言程式設計題目,C語言程式設計題目
給你下思 來路吧第一個 素數演算法不好 源 改用素數篩 沒聽說過的 話 自己搜 很常用的演算法 第二個 對於a先求個位數 然後按照你的演算法求值如果還是超時的話 那麼進行折半遞迴 類似於int get value int a,int b int main include int cacu int a...
C語言程式設計題,C語言程式設計題
long fun int k if i 2 return 1l return k fun k 1 或 include stdio.h main double h,c printf input h n scanf lf h c 5.0 9 h 32 printf c lf c 實驗一 簡單的c程式設計...