- 博客(50)
- 收藏
- 关注
原创 翻转课堂心得
这学期我学习了C++课程,贺老师改变了以往传统的教学模式,采用了翻转课堂这一新的教学模式。翻转课堂是指充分利用学生课余时间,让学生通过网络平台自主学习。在这种教学模式下,课堂内的宝贵时间,学生能够更加专注于主动的基本项目的学习。经过了十几年的传统教育的我,刚开始不适应自主学习的学习方法,因为以前都是老师督促着学习,从而形成了一种被动学习的习惯,等我适应了翻转课堂的学习模式之后觉得,翻转课堂网络时代
2016-06-25 11:44:23 778
原创 用文件保存学生信息
#include #include#include#includeusing namespace std;//定义学生类class Student{public: Student() {}; ~Student(); double get_total(); static int get_stu_num(); s
2016-06-25 11:42:54 1386
原创 程序实践 -银行系统
#include #include #include using namespace std;void aaa(){ cout cout cout cout cout cout cout cout }class Account{public: Account(string a,string b
2016-06-24 22:48:45 574
原创 c++知识点2
多态一词最初来源于希腊语,意思是具有多种形式或形态的情形,当然这只是字面意思,它在C++语言中多态有着更广泛的含义。 2016-06-13 09:09:22第六章 最短路径Floyd-Warshall 多源最短路径问题:求任意两点之间的最短路径。 可以通过深度和广度优先搜索求出两点之间的最短路径:进行n^2遍深度或广度优先搜索,即对每两个点都进行一次深度或广度优先搜索,便可
2016-06-24 22:46:18 517
原创 c++学习知识点
复制构造函数:首先它也是构造函数,所以函数名与类名相同,没有返回值;其次,它只有一个形参,且该形参是对本类类型对象的引用(常用const修饰)。C++——对象复制控制 2016-06-17 09:11:40[C++ 面试基础知识总结] 关联容器标准库共提供了8个关联容器 map 关联数组:保存关键字-值对 set 关键字即值,即只保存关键字的容器 multimap 关键字可重复
2016-06-24 22:45:15 297
原创 阅读程序3
#include using namespace std;int main (){ long pos; ofstream outfile; outfile.open ("test.txt"); outfile.write ("This is an apple",16); pos=outfile.tellp(); outfile
2016-06-24 22:40:40 274
原创 阅读程序2
#include using namespace std;int main (){ long pos; ofstream outfile; outfile.open ("test.txt"); outfile.write ("This is an apple",16); pos=outfile.tellp(); outfile
2016-06-24 22:37:34 437
原创 16周 范型程序补充之vector用法
#include #include #include #include using namespace std; int main() { vector col1; istream_iterator intreader(cin),eof;; while(intreader!=eof) { col1
2016-06-24 22:34:14 416
原创 阅读程序
#include #include includeusing namespace std;int main(){ ifstream readFile; ofstream writeFile; char ch[100]; readFile.open("a.txt", ios::in); writeFile.open("b.txt"
2016-06-24 22:32:13 232
原创 16周阅读程序
#include #include using namespace std;int main(){ ifstream aaa; ofstream bbb; char ch; aaa.open("a.txt", ios::in); bbb.open("b.txt", ios::out); while (aaa.get(ch)
2016-06-24 22:29:20 450
原创 程序填空
#include #include #include #include using namespace std;void aaa(double);int main(){ double arr1[5] = {3, 2.6, 8.7, 1.1, 1.6}; double arr2[5] = {1.6, 9.3, 5, 7.7, 9}; cout
2016-06-24 22:24:38 350
原创 小玩文件
#include #include #include // (1)using namespace std;int main(){ fstream aaa; aaa.open("abc.txt", ios::in); // (2)if(!aaa){ cout exit(1); } char ch
2016-06-24 16:32:27 284
原创 上翻转课堂心得
这学期我学习了C++课程,贺老师改变了以往传统的教学模式,采用了翻转课堂这一新的教学模式。翻转课堂是指充分利用学生课余时间,让学生通过网络平台自主学习。在这种教学模式下,课堂内的宝贵时间,学生能够更加专注于主动的基本项目的学习。经过了十几年的传统教育的我,刚开始不适应自主学习的学习方法,因为以前都是老师督促着学习,从而形成了一种被动学习的习惯,等我适应了翻转课堂的学习模式之后觉
2016-06-24 13:37:33 2051
原创 立体类族共有的抽象类
#include "iostream"using namespace std;const double pai=3.141593;class CSolid{public: virtual double SurfaceArea() const=0; virtual double Volume() const=0;};// 立方体类class
2016-06-22 13:00:33 297
原创 纯虚函数 在面积计算的应用
#include using namespace std;class Shape{public: virtual double area() const =0;};//定义Circle类class Circle:public Shape{public: Circle(double r):banjing(r) {} //构造函数
2016-06-22 10:54:27 512
原创 第十二周 String类的构造
#include #include using namespace std;class String{public: String( ); //默认构造函数 String(const char *); String(String &); //构造函数 ~St
2016-06-22 10:39:08 259
原创 深复制
#include#includeusing namespace std;class A{private: char *a;public: A(char *aa) { a = new char[strlen(aa)+1]; //(a)这样处理的意义在于:不浪费内存空间,节省许多系统单元 strcpy(
2016-06-18 14:01:04 272
原创 C++实践——职员有薪水了
#include #include #include using namespace std;class CPerson{protected: string m_szName; string m_szId; int m_nSex;//0:women,1:man int m_nAge;public: CPers
2016-06-15 20:05:37 738
原创 是春哥啊
#include #include //Name: 春哥using namespace std;class Person{public: Person(char* s){ strcpy(name,s); } void display( ){ cout }private: char n
2016-06-15 19:29:39 286
原创 摩托车继承自行车和机动车
#include #include #includeusing namespace std;enum VehicleStaus {rest, running}; //车辆状态:泊车、行进class Vehicle //车辆类{protected: int maxSpeed; //最大车速 int currentSpeed;
2016-06-15 19:18:54 204
原创 C++实践——存储班长信息的学生类
#include #include using namespace std;class Stu //声明基类{public: Stu(int n, string nam ):num(n),name(nam){} //基类构造函数 void display( ); //成员函数,输出基类数据成员 pro
2016-06-15 16:28:54 287
原创 C++实践参考——人数不定的工资类
#includeusing namespace std;class Salary{public: Salary(int n); //n为职工人数,初始化时完成空间的分配 ~Salary(); //析构函数中释放初始化时分配的空间 void input_salary(); void show_salary();priva
2016-06-15 15:15:51 208
原创 C++实践题:我的数组类
#includeusing namespace std;class MyArray{private:int *arrayAddr; //保存一个有len个整型元素的数组的首地址int len; //记录动态数组的长度int max; //动态数组中的最大值(并非动态数组中必须要的数据成员)public:MyArray(int *a, int n);~MyAr
2016-06-15 15:02:22 582
原创 指向学生类的指针
#include using namespace std;class Student{public: Student(int a,double b):num(a),score(b){} int getnum(); double getscore(); void xinxi();private: int num; //
2016-06-15 14:20:10 208
原创 数组类
#include using namespace std;class Student{public: Student(string na,int nu,double s); Student(){} void set(); void get();private: string name; int num ; d
2016-06-09 09:27:11 221
原创 数组在类中的运算
#include using namespace std;using namespace std;class Salary{public: void set_salarys( ); //输入工资 void add_salarys(int x); //涨工资 void sort_salarys(); //排序工
2016-06-09 08:42:24 240
原创 友元函数,成员函数,普通函数的区别
#include using namespace std;class Time{public: Time(double xx,double yy):x(xx),y(yy){} double getx(){return x;} double gety(){return y;} void aaa1(Time &t); friend v
2016-06-09 08:20:36 1560
原创 带武器的格斗游戏,武器带回血
#include using namespace std;class Weapon{public: Weapon(string wnam, int f); int getForce();private: string wname; //名称 int force; //威力};Weapon::Weapon(s
2016-06-08 19:40:12 555
原创 静态成员的应用:时钟类
#include using namespace std;class Time{public: Time(int=0,int=0,int=0); void show_time( ); //根据is_24和from0,输出适合形式-20:23:5/8:23:5 pm/08:23:05 pm void add_seconds(int); //增加n秒钟
2016-06-08 19:02:41 265
原创 小游戏创意
#include #includeusing namespace std;class Role{public: int baoji();//10%几率打出暴击,暴击伤害加倍 void eat(int d); //吃东西,涨d血 void attack(); //攻击别人,涨n血 void beAttack(); //被攻击,失1血
2016-06-07 20:11:23 305
原创 老题:猜数游戏
#include #include //随机数的头文件using namespace std;int main(){ int a,b,t=0; a=rand()%1000+1; //此程序的核心 cout for(;;) { t++; cin>>b; if(a>b
2016-06-07 19:40:46 377
原创 以前的老题:给小学生出十道题,并判断对了几道
#include #include#includeint qa(); //函数声明,完成一道题的测试并返回评判结果,正确1为,错误为0using namespace std;int main(){ int sum=0;//学生得分 for(int i=0; i { cout sum+=qa();
2016-06-07 19:25:30 537
原创 复数类的运算符重载
#include using namespace std;class Complex{public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r; imag=i;} Complex operator+(const Complex &c2); Complex opera
2016-06-02 08:52:07 286
原创 排列函数模板
#includeusing namespace std;template void Sort(T str[] ,int n){ T t; int i,j; for(i=0;i for(j=0;j if(str[j]>str[j+1]) { t=str[j];str[j]=str[
2016-06-01 19:00:09 203
原创 立体类族共有的抽象类
#include using namespace std;class CSolid{ public: virtual double area()const;//表面积 virtual double volume()const;//体积};class CCube:public CSolid{public: CCube
2016-05-31 20:17:14 182
原创 第十三周,形状类族中的纯虚函数
#include using namespace std;class Shape{ public: virtual double areas()const;};class Circle:public Shape{public: Circle(double r){R=r;} double areas()const{re
2016-05-31 19:27:41 211
原创 个人银行系统管理
#include using namespace std;float bbb(float c,float a,int b) //定义的小函数用来计算{ int i; for(i=0;i c=c+c*a; return c;}class yinhang{public: yinhang(float x,int y
2016-05-19 08:59:32 265
原创 输出成绩最好和最差同学的成绩
#include using namespace std;struct aaa{ char name[10]; //姓名 double fenshu; //分数};int main(){ aaa bbb[5]; int i,min=100,max=0,min1,max1; for(int i=0;i {
2016-05-19 08:19:50 561
原创 泳池和栏杆造价
#include using namespace std;const float pai=3.1416;const float zhalan=35;const float guodao=20;class aaa{public: aaa(float n); float zhuochang(); float mianji();private: floa
2016-05-19 08:16:43 404
原创 用函数重载输出两数乘积
#include using namespace std;int main(){ int aaa(int x,int y); double aaa(double x,double y);char m;int a,b;double x,y;coutcin>>m;coutif(m=='y'){ cin>>a>>b;
2016-05-11 19:41:20 829
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人