- 博客(12)
- 收藏
- 关注
原创 第六周实验报告 任务三
#include#includeusing namespace std;enum SymmetricStyle { axisx,axisy,point};//分别表示按x轴, y轴, 原点对称class CPoint{private: double x; // 横坐标 double y; // 纵坐标public: CPoint(double xx=1,double yy=
2012-03-28 18:46:24 689 2
原创 第五周实验报告 任务三
/* (程序头部注释开始) * 程序的版权和版本声明部分 * Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved. * 文件名称: * 作 者:韩冰 * 完成日期: 2012 年 x 月 x
2012-03-28 18:37:34 435
原创 第五周实验报告 任务二
/* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称:分数类 * 作 者:韩冰 * 完成日期: 2012 年 x 月 x 日*
2012-03-28 18:35:37 382
原创 第五周实验报告 任务一
/* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称:类的初始化 * 作 者:韩冰 * 完成日期: 2012 年 x 月
2012-03-28 18:33:21 362
原创 第四周实验报告 任务三
#include #include using namespace std; class NaturalNumber {private: int n; public: void setValue (int x);//置数据成员 n 的值,要求判断是否是正整数 int getValue(); //返回私有数据成员 n的值
2012-03-28 18:28:21 382
原创 第四周实验报告 任务一
/* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称:三角形类 * 作 者:韩冰 * 完成日期: 2012 年 月 日*
2012-03-28 18:24:35 352
原创 第六周 任务二
#includeusing namespace std;class A{private: int a;public: A(){a = 0;} A(int aa):a(aa){} void show(); };void main(){ A *p; p = new A(1);
2012-03-26 18:37:11 572
原创 第六周 任务一 方法2
#include using namespace std;class C{private: int x;public: C(int x){this->x = x;} int getx()const{return x;}};void main(){ const C c(5); cout<<c.getx()<<endl; system("paus
2012-03-26 18:25:57 412
原创 第六周 任务一 方法1
#include using namespace std;class C{private: int x;public: C(int x){this->x = x;} int getx(){return x;}};void main(){ C c(5); cout<<c.getx()<<endl; system(
2012-03-26 18:21:00 462
原创 第三周任务三
#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_hours(int n);pri
2012-03-05 18:54:21 894 3
原创 任务三
/*(3‐1)输入一行字符,统计其中有多少个单词。每两个单词之间以空格(可能多个)隔开,或者由标点符号(只考虑 , . ; ? !共 5 种)隔开。 如输入: How old are your? I am 20. 输出:There are 7 words in the line. 【知识点:字符数组】 * 算法说明: */ #include
2012-03-05 18:35:35 994
原创 输出组合数
/*(2‐1)组合数求解公式为C = 。编程序输入 m,n,输出组合数,要求用自定义mnmn!(.- )!函数实现求阶乘。 * 算法说明: #include using namespace std;long fac(int n){ long f; if(n==0||n==1)f=1; else f=fac(n-1)*n; return f;
2012-03-05 18:22:37 673
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人