自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(6)
  • 资源 (1)
  • 收藏
  • 关注

原创 王桂林 C++基础与提高 练习题——按需求设计一个圆类

其属性包含圆心和半径创建两个圆形对象,提示用户输入圆心和半径,判断两圆是是否相交main.cpp#include <iostream>#include <math.h>#include "fhnClassList.h"using namespace std;int main(){ double x = 0.0; double y ...

2018-09-01 16:10:19 256

原创 王桂林 C++基础与提高 练习题——求两点间的距离

定义一个Point类,其属性包含点的坐标,提供计算两点间距离的方法。#include <iostream>#include <math.h>using namespace std;class Point{public: Point() { } Point(double a, double b):x(a),y(b) ...

2018-09-01 15:09:30 339

原创 王桂林 C++基础与提高 练习题——类实现单向链表的封装

源码:fhnClassList.h#ifndef _FHN_CLASS_LIST_#define _FHN_CLASS_LIST_#pragma oncestruct Data{ int a; int b;};struct Node{ Data d; struct Node* next;};class fhnClassList{...

2018-08-26 16:15:35 204

原创 王桂林 C++基础与提高 练习题——string数组

题目:读取字符数组 char buf[100] = char buf[100] = "xxxxx:yyyyy:zzzzz:aaaa:bbbb"; 按 : 分解到string数组中去。自己实现总觉得哪里不得劲,尤其是获取:个数和给string数组赋值这两处。走过路过帮忙指点一二,谢谢。自己实现的代码如下:#include <iostream>#include <st...

2018-08-26 12:35:24 358

原创 王桂林 C++基础与提高 练习题—— 函数做默认参数

在王桂林老师给的样例上稍微做了调整。王老师给的样例是:typedef int(*Comp)(int, int);void popSort(int *p, int len, Comp com=ascend);我最终实现为如下的代码:#include <iostream>using namespace std;typedef void(*Exchange)(int...

2018-08-26 11:35:51 461

原创 王桂林 C++基础与提高 练习题——格式时钟输出(实时的,精确到秒)

 这里直接使用了 localtime 函数获取 tm 时间然后做显示。代码如下:#include <iostream>#include <windows.h>#include "time.h"#include <process.h>using namespace std;void Clock(){ struct tm *ptr; ...

2018-08-26 10:46:12 398

华为机试题代码

据说这是2012年华为机试的一道题目,我给出两种方法,两种做法有微小的差别,主要涉及malloc的使用,对初学者应该有帮助

2014-07-03

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除