- 博客(31)
- 收藏
- 关注
原创 第六周实验报告(五)
* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称:类关于点的计算 * 作 者:齐艳红 * 完成日期: 2011年 3月 27日*版 本 号: * 对任务及求解方法的描述部分 *问题描述:计算两点间距离,到原点距离,关于坐标轴等的对称点
2012-03-28 17:19:53 910 1
原创 第六周实验报告(二)
A: #includeusing namespace std;class A {private: int a;public: A() {a=0;} A(int aa):a(aa){} //定义构造函数,用参数aa初始化数据成员a};void main() { A *p; //定义类A的指针对象p p=new A(5);//用p指向动态对象并初
2012-03-27 20:54:20 343
原创 第六周实验报告(四)
* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称:设计三角形类* 作 者:齐艳红 * 完成日期: 2011年 3月 27日*版 本 号: * 对任务及求解方法的描述部分 *问题描述:能够输入三角形三个顶点求出其面积,周长,判断是否为直角
2012-03-27 20:50:25 490 1
原创 第六周实验报告(三)
* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称:类关于点的计算 * 作 者:齐艳红 * 完成日期: 2011年 3月 27日*版 本 号: * 对任务及求解方法的描述部分 *问题描述:计算两点间距离,到原点距离,关于坐标轴等的对称点
2012-03-27 20:44:59 428
原创 第六周实验报告(一)
* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称:学会在类中使用指针 * 作 者:齐艳红 * 完成日期: 2011年 3月 26日*版 本 号: * 对任务及求解方法的描述部分 *问题描述:“cout”: 未声明的标识符,“C::get
2012-03-26 18:48:32 436
原创 第五周任务(二)修改
#include #include using namespace std; int gcd(int x,int y ); class CFraction {private: int nume; // 分子 int deno; // 分母 public: CFraction(int nu=0,int de=1); //
2012-03-23 14:17:30 399
原创 第五周报告(四)
* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称: 设计一个学生类,包括学号,成绩* 作 者:齐艳红 * 完成日期: 2011年 3月 20日*版 本 号: * 对任务及求解方法的描述部分* 输入描述: 用指针指向数组首元素,输出第1、
2012-03-20 18:20:56 637 2
原创 第五周任务(二)
* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 *文件名称: 简单的分数类* 作 者: 齐艳红* 完成日期: 2011年3 月 20日 版 本 号: * 对任务及求解方法的描述部分:制造函数,初始化用 输入描述: * 问题描述: 对分子进行输入,放大,化简等工作* 程序输出: #in
2012-03-20 17:56:35 751 2
原创 第五周任务(三)
* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称: 编写基于对象的程序* 作 者: 齐艳红* 完成日期:2011 年 3月 20日* 版 本 号: * 对任务及求解方法的描述部分:求5个长方柱的体积和面积* 输入描述: 包括数据成员长、
2012-03-20 17:18:37 424
原创 第五周作业(任务1)使用默认参数的构造函数,不给定实参时,默认边长为1
* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称: 使用默认参数的构造函数,不给定实参时,默认边长为1 * 作 者:齐艳红 * 完成日期: 2011年 3月 18日* 版 本 号: * 对任务及求解方法的描述部分* 输入描述: #
2012-03-18 17:23:10 541
原创 第五周实验报告(任务1)
* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称: 构造函数,带参数的构造函数 * 作 者: 齐艳红 * 完成日期: 2011年 3月18 日 版 本 号: * 对任务及求解方法的描述部分* 输入描述: * 问题描述
2012-03-18 17:10:16 463
原创 第五周作业(一)
* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称: * 作 者: 齐艳红 * 完成日期: 2011 年 3 月 18
2012-03-18 16:32:58 380
原创 第四周报告(三)
#include#includeusing namespace std;class NaturalNumber{private: int n; public: void setValue (int x);//置数据成员n的值,要求判断是否是正整数 int getValue(); //返回私有数据成员n的值 bool isPrime(); //判断数据成员n是否为素数,是返回t
2012-03-13 18:29:18 356
原创 第四周实验报告(一)
* Copyright (c) 2011, 烟台大学计算机学院学生* All rights reserved.* 文件名称: * 作 者: 齐艳红* 完成日期:2012 年 3月 13日* 版 本 号: * 对任务及求解方法的描述部分* 输入描述:* 问题描述: * 程序输出: * 程序头部的注释结束*/ #include#includeusing namespace std;clas
2012-03-13 17:07:11 330
原创 模仿第三周任务,判断三角形
#includeusing namespace std;class areas{public: void set_data(); void show_data();private: int len1; int len2; int len3;};void areas::set_data(){ cin>>len1>>len2>>len3;
2012-03-11 17:59:15 380
转载 第三周报告一
#include using namespace std; class Time { public: void set_time( ); void show_time( ); private: bool is_time(int, int, int); //is_time函数仅限于类内使用
2012-03-11 17:50:31 501
转载 第三周实验报告二
#include using namespace std; class Time { public: void set_time( ); void show_time( ); inline void add_a_sec(); //增加1秒钟 inline void add_a_minute(); //
2012-03-11 17:47:01 443
原创 第三周报告三
#includeusing namespace std;class Cube{public: void set_data(); void show_data(); void get_vol(); void get_areas();private: int len; int width; int height; int vol; int
2012-03-06 16:23:44 409 1
原创 二维数组
#include #include using namespace std;void setdata(int a[8][8]); //设置随机数void out(int a[8][8]); //输出数组void outDiagonal(int a[8][8]); //输出对角线元素的值void mine(int a[8][8],int x, int y); //按
2012-03-05 19:17:04 421
原创 指向字符的指针
#include using namespace std;void fun(char*, char*, int);int main(){ char str1[100]="I am a student",str2[100]; int m; cin>>m; fun(str1,str2,m); cout return 0;
2012-03-05 19:15:11 495
转载 揭开关于你生世的秘密
#include using namespace std;struct time{ int year; int month; int day; int hour; int minite; int second;};struct tim{ int year; int month; int day;};struct ti{ i
2012-03-05 15:30:28 2418
原创 运用动态链表处理成绩问题
#include #include#include"iomanip"#include "string"using namespace std;void show_score(int num);//输出成绩;void cin_score(int num);//从文件得到成绩;//定义结构体;struct Student{ char num[12]; str
2012-03-05 15:28:39 474
原创 利用指针排序
#include using namespace std;void bubble_sort(int *p, int num); //不要对自定义函数的声明有任何改动void output_array(int*, int);int main( ) //不要对main函数有任何改动{ int a[20]={86,46,22,18,77,45,32,80,26,88,57,
2012-03-05 15:23:46 528
原创 利用数组求字符串长度
#includeusing namespace std;//函数声明int length(char str[]);void output_frequency(char str[],int n);int main(void) //不要对main函数有任何改动{char str[]="i believe i can do it";coutcoutcout
2012-03-05 15:19:05 812
原创 与上一篇比较
#include using namespace std;void bubble_sort(int arr[], int num);void output_array(int arr[], int num);int main( ) //不要对main函数有任何改动{ int a[20]={86,46,22,18,77,45,32,80,26,88,57,67,20,18
2012-03-05 15:16:18 323
原创 学会冒泡排序算法
#include using namespace std;void bubble_sort(int arr[], int num);void output_array(int arr[], int num);int main( ) //不要对main函数有任何改动{ int a[20]={86,46,22,18,77,45,32,80,26,88,57,67,20,18
2012-03-05 15:14:14 343
原创 学会使用循环控制语句解决实际问题
#include #includeusing namespace std;//在这个问题中,成绩和人数是核心数据,适合作为全局变量处理int score[50]; //将score设为全局变量,在各个函数中可以直接使用int num; //小组人数也设为全局变量void input_score();int get_max_score();int
2012-03-05 15:12:51 371
原创 第二周报告三
#includeusing namespace std;int main(){ int i,a[50],n; cin>>n; for(i=0;n>0;++i) { a[i]=n%2; n=n/2; } for(int j=i-1;j>=0;--j) cout cout return 0;}
2012-03-05 14:38:15 276
原创 第二周报告二
#include using namespace std;long f(int n){ double c; if (n==0||n==1) return 1; else return f(n-1)*n; } int main() { int n,m; double c; do {
2012-03-05 14:32:33 285
原创 第二周报告一
#include using namespace std;void d2b(int n){ int m; if(n==0) cout else { d2b(n/2); m=n%2; cout }}int main(){ int a; cin>>a; d2b(a); return 0;}
2012-03-05 14:27:12 253
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人