自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(94)
  • 收藏
  • 关注

原创 输入一串字符串,运用输出方法计算其中大写 小写 数字 和其他字符的个数

using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class caclass { public static void ca(string s, out

2016-04-01 17:21:34 5067

原创 [C#]第30位数字是多少

/*问题描述:一系列数的规则如下:1 1 2 3 5 8……求第三十位数字是多少*/using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class Program { stati

2016-03-26 13:26:08 1313

原创 银行储蓄系统

代码main.cpp#include #include "bank.h"using namespace std;/*主函数:*/int main(){ cout<<"+----------------------+\n"; cout<<"+ 欢迎光临城通银行 +\n"; cout<<"+----------------------+\n";

2015-07-17 19:12:01 728

原创 第十三周项目2形状类族中的虚函数

程序代码:#include using namespace std;class Shape{public: virtual double area() const =0; //纯虚函数,写const是因为本函数只求值不改变数据成员,故用const保护一下,与虚函数无关};class Circle:public Shape{private: double ra

2015-06-03 08:57:49 704

原创 第十三周项目1动物如何叫

程序代码:#include #includeusing namespace std;class Animal{public: virtual void cry() { cout<<"不知哪种动物,让我如何学叫?"<<endl; }};class Mouse:public Animal{private: string name;

2015-06-03 08:19:49 703

原创 第十二周项目二摩托车继承自行车和机动车

程序代码:#include #include#include using namespace std;enum vehicleStaus {rest, running}; //车辆状态:泊车、行进class Vehicle //车辆类{protected: int maxSpeed; //最大车速 int currentSpeed; //当前速度

2015-05-31 14:19:46 394

原创 第十二周项目一教师兼干部类

程序代码:#include #includeusing namespace std;class Teacher{protected: string name; int age; char sex; string addrest; string number; string title;public: Teacher(strin

2015-05-31 14:17:07 457

原创 第十周项目3点类派生直线类

程序代码:#include#includeusing namespace std;class Point //定义坐标点类{public: Point():x(0),y(0) {}; Point(double x0, double y0):x(x0), y(y0) {}; void PrintPoint(); double getx() {

2015-05-21 16:42:16 282

原创 第十周项目2 - 职员有薪水了

程序代码:#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: CPerson(string name,string

2015-05-21 16:37:20 361

原创 第十周项目1 - 存储班长信息的学生类

程序代码:#include #include using namespace std;class Stu //声明基类{public: Stu(int n, string nam ):num(n),name(nam){}; //基类构造函数 void display( ); //成员函数,输出基类数据成员protected:

2015-05-21 16:33:57 480

原创 第十周项目0是春哥啊

程序代码:#include #include using namespace std;class Person{public: Person(char *s) { strcpy(name,s); } void display() { cout<<"Name"<<name<<endl; }private:

2015-05-21 16:33:12 488

原创 第九周项目2方程也是类

#include using namespace std;class CEquation{private: double a; // 未知数系数 double b; // 常数项 char unknown; // 代表未知数的符号public: CEquation(double aa=0,double bb=0):a(aa),b(b

2015-05-17 19:53:08 507

原创 第八周项目2Time类的运算

#include using namespace std;class CTime{private: unsigned short int hour; // 时 unsigned short int minute; // 分 unsigned short int second; // 秒public: CTime(int h=0,int m=0,

2015-04-29 09:03:06 512 1

原创 第八周项目1.2友元类复数类运算

#include using namespace std;class Complex{public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r; imag=i;} friend Complex operator+(Complex &c1,Complex &c2); friend

2015-04-29 09:01:25 552

原创 第八周项目1.1成员函数的复数类运算

#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 operator-(co

2015-04-29 08:54:57 343

原创 第八章第九章思维导图

2015-04-26 18:24:20 4710

原创 第六周项目4成员函数、友元函数和一般函数有区别

#include #include using namespace std;class CPoint{private: double x; double y; public: CPoint(double xx=0,double yy=0):x(xx),y(yy){} double s1(CPoint&); friend double s2(CPo

2015-04-19 14:24:07 440

原创 第六周项目3人数不定的工资类

#include using namespace std;class Salary{public: Salary(int n); //n为职工人数,初始化时完成空间的分配 ~Salary(); //析构函数中释放初始化时分配的空间 void input_salary(); void show_salary();private: doub

2015-04-19 14:13:18 517

原创 第六周项目2我的数组类

#includeusing namespace std;class MyArray{private: int *arrayAddr; //保存一个有len个整型元素的数组的首地址 int len; //记录动态数组的长度 int max; //动态数组中的最大值(并非动态数组中必须要的数据成员)public: MyArray(int

2015-04-19 14:10:07 331

原创 第五周项目2 - 对象作为数据成员

#include #include using namespace std;class CPoint{private: double X; // 横坐标 double Y; // 纵坐标public: CPoint(double xx=0,double yy=0); void input(); double distance1(CPoint

2015-04-12 19:00:05 279

原创 第五周项目1-体验常成员函数

#include #include using namespace std;class CPoint{private: double x; // 横坐标 double y; // 纵坐标public: CPoint(double xx=0,double yy=0); double Distance1(CPoint p) const; //两点之间的距离(一点是当前点

2015-04-12 18:57:12 530 1

原创 第四周项目3用对象数组操作长方体

#include using namespace std;class Bulk{public: Bulk(double le=1.0,double we=1.0,double he=1.0):legth(le),wedth(we),heigh(he){}; double volume(); double surfacearea(); void displa

2015-04-05 17:55:27 375

原创 第四周项目3指向学生类的指针

#include using namespace std;class Student{public: Student(int n,double s):num(n),score(s) {} void display(); int getNum() { return num; } double getScore() {

2015-04-05 17:53:15 208

原创 项目1.4在构造函数中使用参数初始化表对数据成员初始化

#include #include using namespace std;class Triangle{public: Triangle(double x,double y,double z):a(x),b(y),c(z){}; double perimeter(); double area(); void showMassage();private

2015-04-05 17:35:32 567

原创 第四周项目1.3使用有默认参数的构造函数

#include #include using namespace std;class Triangle{public: Triangle(double x=1,double y=1,double z=1); double perimeter(); double area(); void showMassage();private: doubl

2015-04-05 17:32:37 276

原创 第四周项目1.2设计默认构造函数

#include #include using namespace std;class Triangle{public: Triangle(double x=1,double y=1,double z=1); double perimeter(); double area(); void showMassage();private: doubl

2015-04-05 17:30:38 232

原创 第四周项目1.1三角形类的构造函数使用带参数构造函数

#include #include using namespace std;class Triangle{public: Triangle(double,double,double); double perimeter(); double area(); void showMassage();private: double a,b,c;};

2015-04-05 17:25:14 265

原创 第三周项目4考了语文数学的学生

#includeusing namespace std;class Stu{private: string name; //学生姓名 float chinese; //语文成绩 float math; //数学成绩public: void setStudent(string sname,float fchinese,float fmath)

2015-03-29 14:13:30 241

原创 第三周项目3多文件组织

#include using namespace std;class Triangle{public: void setA(double x) { a=x; } void setB(double y) { b=y; } void setC(double z) { c=z;

2015-03-25 20:07:56 249

原创 第三周项目2三角形类2

#include #include using namespace std;class Triangle{public: void setA(double x) { a=x; } void setB(double y) { b=y; } void setC(double z

2015-03-25 09:01:23 250

原创 第三周项目1三角形类1

#include#includeusing namespace std;class Triangle{public: void setABC(double x, double y, double z);//置三边的值,注意要能成三角形 void getABC(double *x, double *y, double *z);//取三边的值 doub

2015-03-25 08:59:27 243

原创 杂感

现在已经是开学的第二个星期了,c++课程开始了新的教学方法———慕课,刚开始是不适应的,毕竟上了这么多年学都是老师当面讲授的,现在突然变成了自己看视频,角色转换没有那么自然,但是看了几节课之后感觉这样还是很好的。自己掌握到什么地方可以自己调整进度,这样比起老师讲述更加的人性化和多样化,学的好的可以多看点,学的不好的可以重复观看,希望这样的新模式能给课程的学习带来新的动力!

2015-03-22 20:40:18 546 1

原创 第二周项目2长方体

#include using namespace std;class Bullk{public: void data(); void display();private: double length; double width; double height;};void Bullk::data(){ cout<<"请输入长宽高:"

2015-03-22 20:34:25 249

原创 第二周项目1旱冰场造价

#include using namespace std;const int M=20; //水泥场地每平米造价const int N=35;const double pi=3.14; //围栏每米造价class Circle{public: double area(); double circumference(); void setRadius(d

2015-03-22 20:10:43 195

原创 第二周项目1程序阅读2

#include #include using namespace std;class Student{public: void set_data(int n, char *p,char s); void display( );private: int num; char name[20]; char sex;};void Student::

2015-03-22 20:06:18 217

原创 第二周项目1程序阅读

#include #include using namespace std;class Student{ int num; char name[20]; char sex; void set_data(int n,char *p,char s) { num=n; strcpy(name,p); se

2015-03-22 19:58:52 258

原创 第十六周项目4为动态数组扩容

问题及代码:/* *Copyright (c) 2014, 烟台大学计算机学院 *All rights reserved. *文件名称:week16-project2-1-1.cpp *作者:马明城 *完成日期:2014年 12 月 日 *版本号:v1.0 * *问题描述: */#include using namespace std;int main( ){

2014-12-14 16:04:30 438

原创 第十六周项目3指针引用函数

问题及代码:/* *Copyright (c) 2014, 烟台大学计算机学院 *All rights reserved. *文件名称:week16-project2-1-1.cpp *作者:马明城 *完成日期:2014年 12 月 日 *版本号:v1.0 * *问题描述: */#include using namespace std;void eat();void

2014-12-14 16:01:53 422

原创 第十六周项目2.5去掉第一个单词前面的空格

问题及代码:/* *Copyright (c) 2014, 烟台大学计算机学院 *All rights reserved. *文件名称:week16-project2-1-1.cpp *作者:马明城 *完成日期:2014年 12 月 日 *版本号:v1.0 * *问题描述: */#include using namespace std;char *ptrim(char

2014-12-14 16:00:59 461

原创 第十六周项目2.4求单词的个数

问题及代码:/* *Copyright (c) 2014, 烟台大学计算机学院 *All rights reserved. *文件名称:week16-project2-1-1.cpp *作者:马明城 *完成日期:2014年 12 月 日 *版本号:v1.0 * *问题描述: */#include using namespace std;int pwordnum(cha

2014-12-14 15:59:34 523

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除