- 博客(57)
- 收藏
- 关注
原创 第十六周
#include #include #include #include using namespace std; int main() { ifstream readFile; ofstream writeFile; char ch[100]; readFile.open("a.txt", ios:
2013-06-28 10:42:49 566
原创 第十六周
#include #include #include using namespace std;int main(){ double num[500],t; int i,j,k; ifstream infile("salary.txt",ios::in); if(!infile) { cerr<<"open error!"<
2013-06-14 11:01:37 556
原创 15周
#include #include using namespace std;class Animal{public: Animal(string nam) { name=nam; } virtual void cry() { cout<<"不知哪种动物,让我如何学叫?"<<endl; }
2013-06-07 11:06:38 521
原创 十四周
#include using namespace std;class CSolid //基类{ public: virtual double area() const =0; //纯虚函数,求面积 virtual double volume() const =0; //纯虚函数,求体积};class CCube:public CSo
2013-06-02 19:08:35 568
原创 动物类
#include #includeusing namespace std;class Animal{public: virtual void cry() { cout<<"不知哪种动物,让我如何学叫?"<<endl; }}; class Mouse:public Animal{public: //Mouse()
2013-05-31 11:05:12 681
原创 第十四周
#include using namespace std;class Vehicle //交通工具{public: void run() const { cout<<"run a vehicle"<<endl; }};class Car:public Vehicle//汽车{public: void run()
2013-05-31 10:33:07 480
原创 第11周任务
#include using namespace std;class CEquation{ public: CEquation(double a1=0,double b1=0); friend istream & operator>>(istream &in,CEquation &c); friend ostream & operator<<(o
2013-05-20 19:37:04 491
原创 第11周任务
#include using namespace std;class Point{public: Point(double x=0,double y=0);//初始化点坐标为(0,0) double getX()const { return x; } double getY()const
2013-05-20 19:31:17 592
原创 第九周任务
#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);
2013-05-10 10:39:36 539
原创 第八周上机
/* * Copyright (c) 2013, 烟台大学计算机学院 * All rights reserved. * 文件名称:test.cpp * 作者:刘卫丽 * 完成日期:2013 年 4 月 24 日
2013-04-24 20:03:29 629
原创 第六周任务
#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
2013-04-24 19:56:07 499
原创 第八周上级任务
#include using namespace std;class Complex //声明类Complex{public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} friend Complex operator+(Complex &c1,Comp
2013-04-24 19:40:25 565
原创 实现复数类中的运算符重载
#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 Comp
2013-04-19 11:13:24 554
原创 时间类
#include #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 ad
2013-04-15 20:44:00 521
原创 第七周任务
#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 distance
2013-04-15 20:32:31 529
原创 三角类
#include #include using namespace std; //点类 class CPoint { private: double x; // 横坐标 double y; // 纵坐标 public: CPoint(double xx=0,doub
2013-04-10 08:47:52 548
原创 第六周上级任务2
#include using namespace std; class A {private: int *a; int n; int MaxLen; public: A(): a(0), n(0), MaxLen(0) {} A(int*,int,int); ~A(); int GetValue(
2013-04-10 08:40:38 522
原创 分数的各种运算
#include using namespace std;class CFraction{private: int nume; // 分子 int deno; // 分母public: void input(); //按照"nu/de"的格式,如"5/2"的形式输入 void simplify(); //化简(使分子分母没有公因子) void
2013-03-29 11:02:45 633
原创 在构造函数中使用参数初始化对数据初始化
#include #include using namespace std; class Triangle { public: void showMessage(); Triangle (double x=1,double y=1,double z=1):a(x),b(y)
2013-03-29 10:52:00 1401
原创 长方柱类
#include using namespace std; class Box { public: void get_value(); void get_display(); private: void get_volume(); void get_surface();
2013-03-22 11:20:47 678 1
原创 三角类
include#includeusing namespace std;class Triangle{public: inline void setA(double x)//置三边的值,注意要能成三角形 { a=x; } inline void setB( double x) { b=x; } inline void setC
2013-03-22 11:08:53 1135
原创 时间
#include using namespace std; class Time{ public: void set_time(); void show_time(); inline void add_a_sec();//增加1秒钟 inline void add_a_minut
2013-03-19 23:36:09 916
原创 结构体数组的
#include using namespace std; struct student { char num[13]; char name[10]; int cpp; int math; int english; int grade; double ave; }; c
2013-03-13 13:09:28 814
原创 有序的结构体数
#include using namespace std; struct Score { char num[14]; int cpp; int math; int english; }; ; //要自定义的函数 void sort1(Score p[],int n); void sort2(S
2013-03-13 08:50:34 528 1
原创 字符串的连接
01./* Copyright (c) 2012, 烟台大学计算机学院 02.* All rights reserved. 03.* 文件名称:lianjie.cpp 04.* 作 者: 刘卫丽 05.* 完成日期:2013年3月8日 06.* 版 本 号:v1.0 07.* 08.* 输入描述:无 09.* 问题描述:略
2013-03-08 10:32:58 1673
原创 从大到小输出三个整数
#include using namespace std; void s(int &,int &,int &); int main() { int i,j,m; cout<<"输入三个整数:"<<endl; cin>>i>>j>>m; cout<<"从大到小的顺序输出"<<endl; s(i,
2012-12-20 19:59:21 879
原创 比较两个字符串
#include using namespace std; int astrcmp(const char str1[],const char str2[]);//用数组 int main() { int i; char a[50],b[50]; cout<<"请输入一个字符串"<<endl; cin>>a>>b;
2012-12-20 18:59:53 647
原创 成绩处理
/* 02.* Copyright (c) 2012, 烟台大学计算机学院 03.* All rights reserved. 04.* 文件名称:test.cpp 05.* 作者:刘伟丽 06.* 完成日期:20
2012-11-29 17:00:22 773
原创 数组大折腾
01./* 02.* 程序的版权和版本声明部分 03.* Copyright (c)2012, 烟台大学计算机学院学生 04.* All rightsreserved. 05.* 文件名称: array.cpp 06.* 作 者: 刘卫丽07.* 完成日期:2012 年 11月27日 08.* 版本号: v1.0 09.* 10.* 输入
2012-11-27 18:49:11 1165 1
原创 回文素数
01./* 02.* 程序的版权和版本声明部分 03.* Copyright (c)2012, 烟台大学计算机学院 04.* All rightsreserved. 05.* 文件名称:xx.cpp 06. 07.* 作 者:刘卫丽
2012-11-27 09:22:34 1011 1
原创 用迭代的方法输出Fibnacci序列的第20个数
/* 02.* 程序的版权和版本声明部分 03.* Copyright (c)2012, 烟台大学计算机学院学生 * All rightsreserved. 04.* 文件名称: fibnacci.cpp 05.* 作 者:刘卫丽 06.* 完成日期:2
2012-11-22 16:36:06 1303 1
原创 输出星号图2
01./* 02.* Copyright (c) 2012, 烟台大学计算机学院 03.* All rights reserved. 04.* 作 者:刘伟丽 05.* 完成日期:2012 年11 月 15日 06.* 版 本 号:v1.0 07.* 输入描述: 略 08.* 问题描述:调用函数输出星号图
2012-11-15 17:21:40 532 1
原创 调用函数输出星号图
01./* 02. * Copyright (c) 2012, 烟台大学计算机学院 03. * All rights reserved. 04. * 作 者: 刘伟丽 05. * 完成日期:2012 年11月15日 06. * 版 本 号:v1.0 07. * 08. * 输入描述:无 09. * 程序输出:输出星
2012-11-15 16:59:05 561 1
原创 求解分段函数的值
01.* 程序的版权和版本声明部分 02.* Copyright (c)2012, 烟台大学计算机学院学生 03.* All rightsreserved. 04.* 文件名称: fun.cpp 05.* 作 者: 刘卫丽 06.* 完成日
2012-11-15 16:25:33 614 1
原创 1-1000的回文数
02.* Copyright (c) 2012, 烟台大学计算机学院 03.* All rights reserved. 04.* 文件名称:test.cpp 05.* 作者:刘卫丽 06.* 完成日期:2012 年11月8日 07.* 版本号:v1.0 08.*
2012-11-08 17:22:53 1974 3
原创 百鸡百钱
01./* 02.* Copyright (c) 2012, 烟台大学计算机学院 03.* All rights reserved. 04.* 文件名称:test.cpp 05.* 作者:刘卫丽 06.* 完成日期:2012 年 11月 8日 07.* 版本号:v
2012-11-08 16:55:08 1612 1
原创 n的阶成
01./* 02. * Copyright (c) 2012, 烟台大学计算机学院 03. * All rights reserved. 04. * 作 者:刘卫丽 05. * 完成日期:2012 年 11 月8 日 06. * 版 本 号:v1.0 07. * 输入描述:略 08. * 问题描述:n的阶成
2012-11-08 16:39:09 1071 1
原创 将一个正整数分解质因数
* * Copyright (c) 2011, 烟台大学计算机学院 * All rights reserved. * 文件名称:test.cpp * 作者:刘卫丽 * 完成日期:2012 年11月04日 * 版本号:v1.0 * * 输入描述:无 * 问题描述:将一个正整数分解质因子。例如:输入90,打印出90
2012-11-04 12:15:05 1626 2
原创 输出完数
/* *Copyright(c)2012,烟台大学计算机学院 *All rights reserved. *作 者:刘卫丽 *完成日期:2012年11月4日 *版 本 号:v1.0 *输入描述:无 *问题描述:求1000以内的所有完数。 *程序输出:1000以内的完数。 *问题分析:略 *算法
2012-11-04 12:06:09 1042
原创 乘法口诀表
/* * Copyright (c) 2012, 烟台大学计算机学院 * All rights reserved. * 作 者:刘卫丽 * 完成日期:2012 年 11 月 4日 * 版 本 号:v1.0 * * 输入描述: 无 * 问题描述:编程序,输出乘法口诀表 * 程序输出:九九乘法表 * 问题分析:略
2012-11-04 11:48:34 1252
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人