2019年6月12日

实验6

摘要: 1.验证性实验:合并txt文件 2.3.txt末尾追加内容。 #include<iostream> #include<string> #include<fstream> using namespace std; int main(){ ofstream ofapp("3.txt",ios::app) 阅读全文

posted @ 2019-06-12 17:23 褚先生 阅读(89) 评论(0) 推荐(0) 编辑

2019年6月3日

实验5

摘要: 电子宠物 阅读全文

posted @ 2019-06-03 16:14 褚先生 阅读(75) 评论(0) 推荐(0) 编辑

2019年5月19日

实验4

摘要: #ifndef BATTERY_H #define BATTERY_H class Battery { public: Battery(int battery = 70); int getbatterysize(); private: int batterysize; }; #endif #incl 阅读全文

posted @ 2019-05-19 20:20 褚先生 阅读(60) 评论(0) 推荐(0) 编辑

2019年4月30日

3

摘要: #include "info.h" #include #include // 补足必要的头文件 // 。。。 using namespace std; int main() { string nickname,contact,city; int n; vector audienceInfoList; while(cin>>nickname) { ... 阅读全文

posted @ 2019-04-30 14:56 褚先生 阅读(84) 评论(0) 推荐(0) 编辑

1

摘要: #include "date.h" #include "utils.h" #include using std::cout; using std::endl; Date::Date():year(1970),month(1),day(1){}; Date::Date(int y,int m,int d):year(y),month(m),day(d){}; void Date::disp... 阅读全文

posted @ 2019-04-30 14:43 褚先生 阅读(70) 评论(0) 推荐(0) 编辑

2019年4月20日

实验3

摘要: part2 graph 展示效果如下 part3 Fraction描述分数 1 #ifndef FRACTION_H 2 #define FRACTION_H 3 4 class Fraction { 5 public: 6 Fraction(int x = 0, int y = 1) : top( 阅读全文

posted @ 2019-04-20 20:15 褚先生 阅读(98) 评论(0) 推荐(0) 编辑

2019年3月30日

complex类

摘要: #include<iostream> #include<cmath> using namespace std; class Complex { public: Complex(double x, double y) { real = x;imaginary = y; } Complex(double 阅读全文

posted @ 2019-03-30 21:34 褚先生 阅读(134) 评论(0) 推荐(0) 编辑

2019年3月24日

实验2:函数重载、函数模板、简单类的定义和实现

摘要: 1.函数重载编程练习 编写重载函数add(),实现对int型,double型,Complex型数据的加法。在main()函数中定义不同类型 数据,调用测试。 2.函数模板编程练习 编写实现快速排序函数模板,并在main()函数中,定义不同类型数据,调用测试。 头文件 quicksort.h outp 阅读全文

posted @ 2019-03-24 15:00 褚先生 阅读(191) 评论(6) 推荐(0) 编辑

2019年3月16日

实验1:c++简单程序设计(1)

摘要: 实验结论 P63 2-28 (1)If..else.. 进行判断,break continue控制程序流程 #include<iostream> using namespace std; int main(){ char choice; while(1){ cout<<"Menu:A(dd) D(e 阅读全文

posted @ 2019-03-16 16:59 褚先生 阅读(348) 评论(5) 推荐(0) 编辑

导航