- 博客(72)
- 收藏
- 关注
原创 这十月,与C++代码相伴的日子
这十月,与c++代码相伴的日子 去年的这个时候,我刚刚经历了人生中一个重要的关卡——高考,在家等待,那是一种煎熬,我对于自己的未来还是一无所知,不知道会报那所院校,会报哪个专业?在6月27日,知道自己的成绩,我盲目的寻找自己未来的路,最后以为成绩不好,又不想再次经历高三的痛苦与压力,无奈的选择了烟台大学计算机学院对日软件外包专业,我对此充满信心。 在高三暑假进三个月
2012-06-11 18:23:42 1206 1
原创 第十六周任务(三)
#include #include #include using namespace std;class Word{private: string english; string chinese; string xing;public: Word(){}; Word(string w,string c,string x):english(w),chinese(c),xing
2012-06-07 19:42:56 2640
原创 第十六周任务(二)
#include #include #include using namespace std;class student{private: string name; double cpp; double math; double english; double zong;public: student(){}; student(string
2012-06-05 17:27:06 1314 1
原创 第十六周任务(一)
#include #include using namespace std;int main() { double a[500],t; int j,i=0; ifstream readFile; ofstream writeFile; readFile.open("salary.txt", ios::in); if(!readFile) { cerr<<"open er
2012-06-05 16:13:47 1243
原创 第十五周任务(三)
#include #include using namespace std;int main(){ int a; cout<<"input a:";//输出input a: 原因在于给他们加上了双引号。 cin>>a; cout<<"dec:"<<dec<<a<<endl; //输出 dec:2 原因在于它是从左往右输出的。 cout<<"hex:"<<h
2012-05-30 14:43:09 590
原创 第十五周任务(二)
头文件: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
2012-05-29 21:57:23 550
原创 第十五周任务(一)
头文件:class Triangle{public: Triangle(){a=1;b=1;c=1;} Triangle(double x, double y,double z){a = x; b = y; c = z;} double area(void); double zhouchang(void);private: double a,b,c;};源文
2012-05-28 19:11:16 813 1
原创 第十四周任务(一)
#include using namespace std;class MyArray{private: int *arr; //用于存放动态分配的数组内存首地址 int size; //数组大小public: MyArray(int sz=50); MyArray(int a[],int sz); //由一个内置类型的数组初始化 MyArray(const MyArray
2012-05-22 16:52:18 578 1
原创 第十三周任务(三)
#include "iostream"#includeusing namespace std;class CSolid{public : virtual double area() const=0; virtual double Volume() const=0;};class CCube:public CSolid{public: double area() const
2012-05-15 16:47:00 698
原创 第十三周任务(三)
#include "iostream"#includeusing namespace std;class Shape{public : virtual double area() const=0;};class Circle:public Shape{public: double area() const; Circle (double r):R(r){}private
2012-05-15 16:08:54 503
原创 第十三周任务(二)
#include "iostream"#includeusing namespace std;class Animal{public: virtual void cry() {cout<<"不知哪种动物,让我如何学叫?"<<endl;}};class Mouse:public Animal{public: void cry() { cout<<"
2012-05-14 18:30:36 696
原创 第十三周任务(1)
#include using namespace std;class Vehicle {public: void run() const { cout << "run a vehicle. "<<endl; } //(2) run()为虚函数}; class Car: public Vehicle {public: void run() con
2012-05-14 17:44:14 560
原创 第十二周任务(三)
#include #include#include using namespace std;enum vehicleStaus {rest, running}; //车辆状态:泊车、行进class vehicle //车辆类{protected: int maxSpeed; //最大车速 int currentSpeed; //当前速度 int weight; //车重
2012-05-09 17:04:22 636 1
原创 第十二周任务(二)
#include #include using namespace std;class Teacher{protected: string name; int age; char sex; string address; int tep; string title;public: Teacher(string nam,int a,char s,string ad,int
2012-05-07 22:55:34 784
原创 第十周任务(3)
#include using namespace std;class Point {public: Point(double a,double b):x(a),y(b){} void setPoint(double a,double b); double getX(){return x;} double getY(){return y;}protected: double x;
2012-04-25 18:43:03 742
原创 第十周任务(2)
#include #include #include //setw:设置输出数据的宽度,使用时应#include using namespace std;class CPerson {protected: char *m_szName; char *m_szId; int m_nSex;//0:women,1:man int m_nAge;public: CPerson(
2012-04-24 21:04:49 908
原创 第十周任务(一)
#include#includeusing namespace std;class Point //定义坐标点类{public: double x,y; //点的横坐标和纵坐标 Point(){x=0;y=0;} Point(double a,double b) {x=a; y=b;} void PrintP(){cout<<"Point:("<<x<<","
2012-04-23 18:45:36 3762
原创 第九周任务(5)
#include using namespace std; class Douary { public: Douary(int m, int n);//构造函数:用于建立动态数组存放m行n列的二维数组(矩阵)元素,并将该数组元素初始化为 Douary(const Douary &d);//构造函数:用于建立动态数组存放m行n列的二维数组(矩阵)元素,并将该
2012-04-17 22:15:37 497
原创 第九周任务(4)
#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-17 19:30:01 655
原创 第九周任务(三)
#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
2012-04-15 21:45:19 558
原创 第九周任务(二)
#include using namespace std; class CTime { private: unsigned short int hour; // 时 unsigned short int minute; // 分 unsigned short int second; // 秒 pub
2012-04-15 21:26:30 489
原创 第九周任务(一)
#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);
2012-04-15 21:10:54 462
原创 第八周任务(3)
#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-10 21:49:42 588 1
原创 第八周任务(二)
#include using namespace std; class CTime { private: unsigned short int hour; // 时 unsigned short int minute; // 分 unsigned short int second; // 秒 pub
2012-04-09 21:43:50 361
原创 第八周任务(一)3
#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 Comple
2012-04-09 18:38:55 385
原创 第八周任务(一)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 Comple
2012-04-09 18:19:22 389
原创 第八周任务(一)
#include using 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);
2012-04-09 18:12:48 404
原创 第七周任务(1)
#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_
2012-04-03 20:52:53 709 3
原创 第七周任务(3)第二种算法
#include #include using namespace std; template class Comple { private: numtype real; numtype imag; public: Comple(){real = 0;imag = 0;} Comple(numtype r,num
2012-04-03 19:33:08 384
原创 第七周任务(3)
#include #include using namespace std; template class Comple { private: numtype real; numtype imag; public: Comple(){real = 0;imag = 0;} Comple(numtype r,num
2012-04-03 19:25:09 761 1
原创 第七周任务(2)
#include #include using namespace std;class CPoint {private: double x; // 横坐标 double y; // 纵坐标 public: CPoint(double xx=0,double yy=0):x(xx),y(yy){} friend
2012-04-02 18:44:11 369
原创 第二十
第13周报告3:实验目的:学会使用自定义函数解决实际问题,学会函数的嵌套调用实验内容:编制一个三角函数表 * 程序头部注释开始(为避免提交博文中遇到的问题,将用于表明注释的斜杠删除了)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生* All rights reserved.* 文件名称: 求解三角函数
2012-04-01 10:41:00 402
原创 第十九
第13周报告2(请在另外一篇博文中提交):实验目的:学会使用自定义函数解决实际问题实验内容:定义自定义函数,计算sin和cos的近似值 * 程序头部注释开始(为避免提交博文中遇到的问题,将用于表明注释的斜杠删除了)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生* All rights reserved.* 文件名称:
2012-04-01 10:40:19 331
原创 第十八
第13周报告1:实验目的:学会使用函数编程,以及设计比较完备的测试用例完成对小程序的测试实验内容:用函数完成分段数学函数的求解#include using namespace std;const double x1=0.3, x2=0.8; //定义为全局常变量,方便,易维护double f(double); //此处加入对自定义函数f的声明int main( ){
2012-04-01 10:39:44 334
原创 第十七
#includeusing namespace std;int main (){char m;int p; double j,q,i;cout<<"请输入储蓄金额"<<endl;cin>>j;cout<<"a 定期"<<"b 活期"<<endl;cin>>m;if(m!='a'){cout<<"请选择储蓄期限"<<endl;cin>>p;q=0.0050*p/3
2012-04-01 10:39:05 323
原创 第十六
第12周报告2-2(请在另外一篇博文中提交):实验目的:学会使用循环控制语句解决实际问题实验内容:编写大奖赛用的计分程序* 程序头部注释开始(为避免提交博文中遇到的问题,将用于表明注释的斜杠删除了)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生* All rights reserved.* 文件名称:* 作 者: 徐国晨* 完成日期
2012-04-01 10:38:37 324
原创 第十五
第12周报告2-2(请在另外一篇博文中提交):实验目的:学会使用循环控制语句解决实际问题实验内容:编写大奖赛用的计分程序* 程序头部注释开始(为避免提交博文中遇到的问题,将用于表明注释的斜杠删除了)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生* All rights reserved.* 文件名称:* 作 者: 徐国晨* 完成日期
2012-04-01 10:38:00 266
原创 第十四
第12周报告2-2(请在另外一篇博文中提交):实验目的:学会使用循环控制语句解决实际问题实验内容:编写大奖赛用的计分程序 * 程序头部注释开始(为避免提交博文中遇到的问题,将用于表明注释的斜杠删除了)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生* All rights reserved.* 文件名称:
2012-04-01 10:37:15 317
原创 第十三
第12周报告1:实验目的:学会使用循环控制语句解决实际问题,并强化注重效率的观念实验内容:用循环控制语句编写程序,完成表达式的计算* 程序头部注释开始(为避免提交博文中遇到的问题,将用于表明注释的斜杠删除了)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生* All rights reserved.* 文件名称:
2012-04-01 10:35:34 336
原创 第十二
第11周报告2(请在另外一篇博文中提交):实验目的:学会使用循环控制语句解决实际问题实验内容:编程序生成一张从英尺到米的转换表 * 程序头部注释开始(为避免提交博文中遇到的问题,将用于表明注释的斜杠删除了)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生* All rights reserved.* 文件名称:
2012-04-01 10:34:32 309
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人