自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 这十月,与C++代码有关的日子

转眼这一学期又过去了,感觉很快。c++已经学了一年了。怎么说呢,对于c++我谈不上喜欢,当然,也并不反感,不好不坏吧。刚接触c++时感觉很新奇,可是作了几次任务后发现并不是那么回事。c++并不是那么容易的,有许多东西都要去记,还要学会灵活去用,老师讲一些要点,之后就要靠自己了,我这个人惰性很重,没人督促就很难去做,课后的任务,很难做好,总是拖到最后。导致对c++学习的兴趣不大,用的时间不多,我甚

2012-06-13 22:06:36 774 2

原创 第十五周任务二

class CFraction{private: int nume; int deno;public: CFraction(int nu=0,int de=1):nume(nu),deno(de){} void simplify(); void display(); CFraction operator +(CFraction &c1); CFraction opera

2012-05-30 19:43:27 623 1

原创 第十五周任务一

class Triangle{public : Triangle(){a = 1;b = 1;c = 1;} Triangle (double x,double y,double z){a = x; b = y;c = z;} double perimeter(void); double area(void);private : double a,b,c;};#include

2012-05-30 18:08:50 479

原创 第十三周任务三

#include using namespace std;const double pi = 3.1415926;class Shape{public: virtual double area() const = 0;};class Circle:public Shape{public: Circle(double r):rang(r){} ~Circle(); doub

2012-05-16 18:30:22 372

原创 第十三周任务二

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

2012-05-16 17:42:47 496 1

原创 第十三周任务一

输出1.1arun a vehiclerun a carrun a airplaneb run a vehiclerun a vehicle1.2arun a vehiclerun a carrun a airplanebrun a carrun a airplane1.3arun a vehiclerun a car

2012-05-16 17:40:16 476

原创 第十二周任务三

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

2012-05-09 17:02:56 747 1

原创 第十二周任务一

#include #includeusing namespace std;class Student //(1)修改student类中各数据成员和成员函数的访问限定符,并观察发生的现象{public: Student(int n,string nam,char s); void show(); ~Student( ){ } protected: int num; stri

2012-05-09 16:48:33 370

原创 第十二周任务二

#include#includeusing namespace std;class Teacher{protected: string name; int age; string addr; char sex; int num; string title;public: Teacher( string na ,int a , string add ,char s, int

2012-05-08 21:39:30 455

原创 第十周任务二

#include #include #include //setw:设置输出数据的宽度,使用时应#include using namespace std;class CPerson {protected:char *m_szName;char *m_szId;int m_nSex;//0:women,1:manint m_nAge;public:CPerson(char

2012-04-25 16:46:26 404 1

原创 第十周任务一

#include#includeusing namespace std;class Point //定义坐标点类{public: double x,y; //点的横坐标和纵坐标 Point(){x=0;y=0;} Point(int x0,int y0) {x=x0; y=y0;} void PrintP(){cout<<"Point:("<<x<<","<<y<<")";}

2012-04-23 21:09:09 356

原创 第九周任务五

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

2012-04-18 19:01:35 350

原创 第九周任务三

#include using namespace std; class CFraction { private: int nume; // 分子 int deno; // 分母 public: CFraction(int nu=0,int de=1):nume(nu),deno(de){} void simplify();

2012-04-17 21:59:45 435

原创 第九周任务二

#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,int s=0); vo

2012-04-16 20:46:20 543

原创 第九周任务一

#includeusing namespace std;class Complex{public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} Complex operator+(Complex &c2); Complex operator-(Complex &c2); Comple

2012-04-16 20:38:44 716

原创 第八周任务三

#include using namespace std;class CFraction{private: int nume; int deno;public: CFraction(int nu=0,int de=1):nume(nu),deno(de){} void simplify(); void display(); CFraction operator +(

2012-04-11 20:42:19 655 1

原创 第八周任务二

#include using namespace std; class CTime { private: unsigned short int hour; // 时 unsigned short int minute; // 分 unsigned short int second; // 秒 public: CTime

2012-04-10 20:29:16 553

原创 第八周任务一

#includeusing namespace std;class Complex{public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} Complex operator+(Complex &c2); Complex operator-(Complex &c2); Comple

2012-04-09 22:02:11 371

原创 第七周任务三

/* (程序头部注释开始) * 程序的版权和版本声明部分 * Copyright (c) 2011, 烟台大学计算机学院学生  * All rights reserved. * 文件名称:                               * 作    者:李鲁超                               * 完成日期:   2012

2012-04-04 19:15:26 591

原创 第七周任务二

#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 distance1 ( CPoint & );//

2012-04-04 19:08:29 556 1

原创 第七周任务一

#includeusing 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秒钟 void add_minutes(

2012-04-03 20:41:25 266

原创 第六周任务三

#include #include using namespace std;enum SymmetricStyle { axisx,axisy,Point};//分别表示按x轴, y轴, 原点对称class CPoint{private: double x; // 横坐标 double y; // 纵坐标public: CPoint(double xx=0,double y

2012-03-28 19:04:18 505 1

原创 第六周任务二

a. 用指针访问对象class A {private: int a;public: A() {a=0;} _A(int aa):a(aa)___{}  //定义构造函数,用参数aa初始化数据成员a};main() { A *p__;  //定义类A的指针对象p ___p=newA(5) __;   //用p指向动态对象并初始化为整数}

2012-03-27 22:09:47 325

原创 第六周任务一

class C  { private:      int x;   public:      C(int x){this->x= x;}      int getX(){return x;}  };  void main()  {      C c(5);   //去掉const      cout    system("pause");  }

2012-03-27 22:00:13 256

原创 第五周任务三

#include   using namespace std;  class NaturalNumber  {private:      int n;   public:      void setValue (int x);//置数据成员n的值,要求判断是否是正整数      int getValue();  //返回私有数据成员n的值      bool isP

2012-03-21 20:01:58 485 1

原创 第四周任务一

【任务1】下面设计一个三角形类,请给出各成员函数的定义 #includeusing namespace std;class Triangle{public:void Setabc(float x, float y, float z);//置三边的值,注意要能成三角形void Getabc(float *x, float *y, float *z);//取三边的值floa

2012-03-21 19:38:08 361

原创 第5周任务一

#include#includeusing namespace std;class Triangle{public:   Triangle(double x=1,double y=1,double z=1);double perimeter(void);//计算三角形的周长double area(void);//计算并返回三角形的面积void showMessage

2012-03-19 21:05:59 569 1

原创 第三周

实验报告模板1. 本学期的报告均发到csdn博客。周一上机,周四前要完成本周上机任务并发布博文。代码应该用代码工具插入,见http://blog.csdn.net/sxhelijian/article/details/72030862. 本学期起程序头部的注释请自行加入,从本学期起不再统一给出。这是一个程序员良好习惯中的一部分,养成这个习惯。这也是展示个人专业品质的一个重要途径。另外,在程序中

2012-03-14 20:24:05 431 1

原创 第二周

1-1#include using namespace std;void d2b(int n){ if( n==0 )  cout else {   cout  d2b(n/2); }      }  int main()  {   int a;   cin>>a;//输入十进制数   d2b(a);//转换成二进制数输出

2012-03-04 22:14:43 298

空空如也

空空如也

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

TA关注的人

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