- 博客(20)
- 收藏
- 关注
原创 第六周实验报告(4)
#include #include using namespace std; class CPoint { private: double x; // 横坐标 double y; // 纵坐标 public: CPoint(double xx=0,double yy=0); double distance(CPo
2012-03-27 20:27:41 437 1
原创 第六周实验报告(3)
#include #include using namespace std; enum SymmetricStyle { axisx,axisy,point};//分别表示按x轴, y轴, 原点对称 class CPoint { private: double x; // 横坐标 double y; // 纵坐标 public:
2012-03-27 20:27:28 469
原创 第六周实验报告(1)
第一种修改方法 class C { private: int x; public: C(int x) { this->x= x; } int getX() { return x; } }; void main() { C c(5); //去掉const cout<<c.getX();
2012-03-27 20:26:49 307
原创 第五周实验报告(四)
#include using namespace std; class Class { public: Class(int a=0,int b=0):num(a),score(b){} void show(); int put_score(); private: int num; int score; }; void Class::show() { co
2012-03-19 22:04:19 254
原创 第五周实验报告(三)
#include using namespace std; class Box { public: Box(int len=10,int w=10,int h=10):length(len),width(w),heigth(h){} int volume(); int area(); void set_Box(); private: int leng
2012-03-19 22:03:58 278
原创 第五周实验报告(二)
#include #include #include using namespace std; int gcd(int , int); class CFraction { public: CFraction(int nu=0,int de=1); void input(); void simplify(); void amplify(int n); voi
2012-03-19 22:03:31 255
原创 第五周实验报告(一)
/* (程序头部注释开始) * 程序的版权和版本声明部分 * Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved. * 文件名称: * 作 者: 程龙 * 完成日期: 年 3 月
2012-03-19 21:58:51 503 1
原创 第四周实验报告(4)
#include using namespace std; class Salary { public: void input_salary(); void add_salary(); void show_salary(); private: double sa
2012-03-12 21:51:02 420 1
原创 第四周实验报告(3)
#include #include using namespace std; class NaturalNumber { private: int n; public: void setValue (int x);//置数据成员n 的值,要求判断是否是正整数 int getValue(); //返回私有数据成员n 的值
2012-03-12 21:50:52 396
原创 第四周实验报告(1)
/* (程序头部注释开始) * 程序的版权和版本声明部分 * Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved. * 文件名称: Triangle.cpp * 作 者: 计114-4 程龙 * 完成日期: 2012 年
2012-03-12 21:50:16 273
原创 第三周实验报告(4)
#include using namespace std; class Box { public: void get_value(); void display(); float volume(); float area(); private: float length; float width; float height; }; v
2012-03-05 18:14:14 330
原创 第三周实验报告(3)
#include using namespace std; class Time { public: void set_time(); void show_time(); void change_time(); void add_seconds(int n); void add_minutes(int n); void add_
2012-03-05 18:13:59 435 1
原创 第三周实验报告(2)
#include using namespace std; class Time { public: void show_time(); void set_time(); private: int hour; int minute; int sec; }; int main() { Time t; t.set_time(); t.show_time(
2012-03-05 18:12:22 358
原创 第二周实验报告(4)
#include #include "string.h" using namespace std; void change_word(char ch[100]); int main() { char ch[100]; cin.getline(ch,100); change_word(ch); return 0; } void change_word(ch
2012-03-05 18:10:29 236
原创 第二周实验报告(3)
#include #include "string.h" using namespace std; void check_word(char ch[100]); int count=0; int main() { char ch[100]; cin.getline(ch,100); check_word(ch); cout r
2012-03-05 18:07:28 313
原创 第二周实验报告(2)
#include using namespace std; long fac(int n) { long p; if(n==0||n==1) p=1; else p=n*fac(n-1); return p; } int main() { int n,m,p;
2012-03-05 18:07:09 263
原创 第二周实验报告(1)
#include using namespace std; void d2b(int n) { if(n cout else { d2b(n/2); cout } } int main() { int n; co
2012-03-05 18:06:40 241
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人