上一页 1 ··· 3 4 5 6 7 8 9 下一页

2017年11月18日

抽象类实验:SIM卡抽象

摘要: 抽象SIM:package sim_package;public abstract class SIM { public abstract String giveNumber(); public abstract String giveCorpName(); publ... 阅读全文

posted @ 2017-11-18 09:29 MACHINE_001 阅读(215) 评论(0) 推荐(0) 编辑

2017年11月11日

子类与继承:实验1

摘要: package Example;public class People { double height,weight; People(){ height=0; weight=0; } People(double height, double weight){ t... 阅读全文

posted @ 2017-11-11 09:52 MACHINE_001 阅读(189) 评论(0) 推荐(0) 编辑

2017年11月10日

Test类实验

摘要: package PC_TEST;class CPU{ int speed; CPU(){ speed=0; } CPU(int k){ speed=k; } void setSpeed(int k){ speed=k; } int setSpeed(){ re... 阅读全文

posted @ 2017-11-10 15:36 MACHINE_001 阅读(116) 评论(0) 推荐(0) 编辑

2017年11月7日

函数:显式具体化模板函数 引用结构

摘要: #include template void Swap(T &a, T &b);struct job{ char name[40]; double salary; int floor;};template void Swap(job &j1, job &j2);vo... 阅读全文

posted @ 2017-11-07 09:24 MACHINE_001 阅读(84) 评论(0) 推荐(0) 编辑

函数:使用函数模板,泛型引用,重载进行数据交换

摘要: #include template void Swap(T *a, T *b, int n);template void Swap(T &a, T &b);void Show(int a[]);const int Lim = 8;int main(void){ usi... 阅读全文

posted @ 2017-11-07 08:30 MACHINE_001 阅读(137) 评论(0) 推荐(0) 编辑

函数:模板的使用

摘要: #includetemplate void Swap(T &a, T &b);int main(void){ using std::cout; int i=10, j=20; cout void Swap(T &a, T &b){ T temp; temp = a... 阅读全文

posted @ 2017-11-07 08:11 MACHINE_001 阅读(66) 评论(0) 推荐(0) 编辑

2017年11月6日

函数:使用函数重载及默认参数实现程序

摘要: #include unsigned long left(unsigned long num, unsigned ct);char * left(const char *str, int n=1);int main(void){ using namespace std;... 阅读全文

posted @ 2017-11-06 16:17 MACHINE_001 阅读(85) 评论(0) 推荐(0) 编辑

函数:引用file类对象及io类对象作为参数打印文本及显示文本

摘要: #include #include #include using namespace std;void file_it(ostream & os, double fo, const double fe[], int n);const int LIMIT = 5;int... 阅读全文

posted @ 2017-11-06 14:34 MACHINE_001 阅读(103) 评论(0) 推荐(0) 编辑

函数:按引用传递函数参数进行操作

摘要: #include #include struct free_throws{ std::string name; int made; int attempts; float percent;};void display(const free_throws & ft);v... 阅读全文

posted @ 2017-11-06 11:35 MACHINE_001 阅读(101) 评论(0) 推荐(0) 编辑

2017年11月4日

类:实验3共饮同井水

摘要: 实验要求:编写程序模拟两个村庄共用同一口井水。编写一个Village类,该类有一个静态的int型成员变量waterAmout,用于模拟井水的水量。在主类Land的main()方法中创建两个村庄,一个村庄改变了waterAmount的值,另一个村庄查看waterAmou... 阅读全文

posted @ 2017-11-04 15:15 MACHINE_001 阅读(893) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7 8 9 下一页

导航