- 博客(51)
- 资源 (10)
- 收藏
- 关注
原创 Day 1: Quartiles
内容:说明:四分位的计算示例代码:// Day1_Quartiles.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <vector>#include <iostream>#include <algorithm>using namespace std;//by zhaoclint main(...
2018-04-28 16:17:33 238
原创 Day 0: Weighted Mean
内容:说明:计算加权平均值示例代码:// Day0_WeightedMean.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <vector>#include <iostream>using namespace std;//by zhaoclint main(){ int n; cin ...
2018-04-28 14:24:31 334
原创 Day 0: Mean, Median, and Mode
内容:说明:1、给定N个整数的数组2、求mean(平均值)、median(中位值、整数数目为单时即中间数目的值,为双时即中间两个数的平均值)、mode(出现次数最多的最小数)示例代码:// Day0_MeanMedianandMode.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <map>#include <vec...
2018-04-28 13:54:39 1402
原创 Bit Array
内容:说明:无~示例代码:#include <cmath>#include <cstdio>#include <vector>#include <iostream>#include <algorithm>using namespace std;#define f(x, p, q) ( (x * p) + q )typed...
2018-04-27 15:44:00 436
原创 C++ Variadics
内容:说明:类模板多参数示例代码:// C++Variadics.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>using namespace std;template <bool a> int reversed_binary_value(){ return a;}tem...
2018-04-27 15:40:03 256
原创 Attending Workshops
内容:说明:按部就班即可~示例代码:// AttendingWorkshops.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <vector>#include <algorithm>#include <iostream>using namespace std;struct Workshop...
2018-04-27 15:06:23 218
原创 Magic Spells
内容:说明:dynamic_cast的使用示例代码:// Magic_Spells.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <string>#include <iostream>using namespace std;class Spell{private: string scrollN...
2018-04-27 13:53:45 589
原创 指针与const
内容见代码注释示例代码:// Pointer_Const.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>using namespace std;void inCrement( int *start, int *end ){ int *cur = start; while( cur...
2018-04-27 10:10:39 186
原创 Accessing Inherited Functions
内容:给定3个基类A,B,C,完成D类 update_val 函数说明:继承多基类时的访问示例代码:// AccessingInheritedFunctions.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>using namespace std;class A{public: A()...
2018-04-27 00:24:05 119
原创 Abstract Classes - Polymorphism
内容:说明:特定数量键值对,超过数量,最后的替换最开始的示例代码:// AbstractClasses-Polymorphism.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <string>#include <map>#include <iostream>using namespace std...
2018-04-26 13:47:13 148
原创 Attribute Parser
内容:说明:通过输入的xml信息,查找对应的值示例代码:// Attribute_Parser.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <map>#include <sstream>#include <iostream>using namespace std;/*sample inp...
2018-04-26 11:32:17 420
原创 Deque-STL
内容:说明:找出子排队的最大值示例代码:// Deque-STL.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <deque>#include <iostream>#include <algorithm>using namespace std;//timeoutvoid printKMax...
2018-04-25 16:08:37 245
原创 Operator Overloading
内容:说明:运算符重载示例代码:// Operator_Overloading.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <vector>#include <iostream>using namespace std;class Matrix{public: vector<vector...
2018-04-25 11:25:41 720
原创 C++ Class Template Specialization
内容:说明:类模板的使用示例代码:// Class_Template.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <string>#include <iostream>using namespace std;enum class Color{ red, green, orange};enu...
2018-04-24 13:52:54 820
原创 Virtual Functions
内容:说明:纯虚函数以及静态变量的使用示例代码:// Virtual_Functions.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <string>#include <vector>#include <iostream>using namespace std;class Person{...
2018-04-23 17:09:26 369
原创 MessageBox像printf一样格式化输出
前言:对于习惯了使用printf输出的人来说,MessageBox的输出并不十分尽如人意,如果能像printf那样进行格式化输出就好了~当然,先对字符串format再MessageBox也是可以的~示例代码:#include <windows.h>#include <stdio.h>#define MAX_BUFF 1024int CDECL Me...
2018-04-22 23:04:13 3307
原创 strlen与wcslen引发的一些思考
示例代码:// strleng.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <string>//by zhaoclint main(){ char str[] = "Hello!"; printf( "字符串长度:%d,字节数:%d\n", strlen( str ), sizeof( st...
2018-04-21 23:49:18 7273
原创 TEXT和_T使用说明
先看下这两者的简单使用:#include "tchar.h"#include <windows.h>int WINAPI WinMain( HINSTANCE hinstance, HINSTANCE preinstance, LPSTR lcmdline, int nShowCmd ){ if( UNICODE ) { MessageBox(...
2018-04-20 23:42:22 1866
原创 Exceptional Server
内容:说明:异常处理示例代码:// Exceptional_Server.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <vector>using namespace std;class Server{private: static int load;p...
2018-04-11 23:34:24 369
原创 Inherited Code
内容:说明:1、输入整数n:测试次数2、输入字符串,字符少于5个抛出异常,正常的输出Valid(除去网址)示例代码:// Inherited_Code.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <exception>#include <sstream>#i...
2018-04-11 22:50:42 158
原创 Overload Operators
内容:说明:操作重载示例代码:// Overload_Operators.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <string>using namespace std;class Complex{public: int a, b; void i...
2018-04-10 23:47:08 398
原创 Preprocessor Solution
内容:说明:预处理的作用示例代码:// Preprocessor_Solution.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <vector>using namespace std;#define toStr(x) #x#define io(v) cin >...
2018-04-09 21:50:44 239
原创 C++ Class Templates
内容:说明:类模板的基础使用示例代码:// C++ClassTemplates.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <string>using namespace std;template <class T>class AddElements{...
2018-04-08 22:46:03 253
原创 duilib设置颜色ARGB
前言:duilib中设置颜色时使用的是ARGB而不是RGBA,弄错了就会得到错误的颜色效果。使用说明:1、RGB值转换为16进制:在线转换2、可以看到除了RGB(转换后6位)还有个透明度(2位),两者都选好之后才是我们需要的8位16进制颜色3、但是如果使用RGB+A(透明度),往往得到的并不是我们想要的颜色,所以要A+RGB4、比如如果想要得到图上的颜色,就要设置为#FF6565C8,而不是#65...
2018-04-08 21:46:15 2125
原创 Multi Level Inheritance
内容:说明:多重继承的使用示例代码:// MultiLevel_Inheritance.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>using namespace std;class Triangle{public: void triangle() { cout ...
2018-04-08 08:10:37 267
原创 Rectangle Area
内容:说明:继承的基本应用~示例代码:// Rectangle_Area.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>using namespace std;class Rectangle{public: void display() { cout <<...
2018-04-07 23:30:42 319
原创 Inheritance Introduction
内容:说明:继承的基本应用示例代码:// Inheritance_Introduction.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>using namespace std;class Triangle{public: void triangle() { cou...
2018-04-07 22:06:02 151
原创 Print Pretty
内容:说明:cout输出double类型数据的格式化示例代码:// Print_Pretty.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <iomanip>using namespace std;//by zhaoclint main(){ int T;...
2018-04-07 20:41:42 577
原创 Maps-STL
内容:说明:示例代码:// Maps_STL.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <string>#include <map>using namespace std;//by zhaoclint main(){ int n; ...
2018-04-07 15:03:57 275
原创 Sets-STL
内容:说明:1、给定一个整数(查询次数)2、每次输入两个整数x,y(x表示类型1:插入2:删除3:查找)(y表示数值)3、查找到输出Yes,否则No示例代码:// Sets_STL.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <set>using namespace st...
2018-04-07 12:42:34 404 1
原创 Lower Bound-STL
内容:说明:1、给定一个排好序的整数队列2、给出整数,查找到就输出该数的下标,找不到,就输出比该数大的最小整数示例代码:// LowerBound_STL.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <vector>#include <algorithm>u...
2018-04-06 23:08:28 512
原创 Vector-Erase
内容:说明:vector的erase两种方法的使用,因为元素下标是从0开始,所以要删除时数值要对应减1示例代码:// Vector-Erase.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <vector>using namespace std;//by zhaocl...
2018-04-06 21:59:23 232
原创 Vector-Sort
内容:说明:vector的基本用法示例代码:// Vector_Sort.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <algorithm>#include <vector>using namespace std;//by zhaoclint main...
2018-04-06 21:37:27 208
原创 C++关键字explicit的使用说明
前言:C++提供了关键字explicit,可以阻止不应该允许的经过转换构造函数进行的隐式转换的发生。声明为explicit的构造函数不能在隐式转换中使用。C++中, 一个参数的构造函数(或者除了第一个参数外其余参数都有默认值的多参构造函数), 承担了两个角色。 1 是个构造器 ,2 是个默认且隐含的类型转换操作符。所以, 有时候在我们写下如 AAA = XXX, 这样的代码, 且恰好XXX的类型正...
2018-04-06 00:53:59 326
原创 获取变量字节以及存储的最大值和最小值
前言:各种变量类型在内存中存储都需要占用内存(即字节数),并且该类型都有各自能存储的最大值以及最小值,因电脑而异。示例代码:// type_value.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <limits>using namespace std;//by zha...
2018-04-05 23:50:57 1088
原创 Box It!
内容:说明:比上一节的class多了运算符的重载示例代码:// Box_It.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>using namespace std;class Box{public: Box() { l = 0; b = 0; ...
2018-04-05 11:55:17 450
原创 Classes and Objects
内容:说明:类和对象的基本使用示例代码:// Classes and Objects.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <vector>using namespace std;class Student{public: Student() ...
2018-04-05 00:51:38 349 1
原创 Class
内容:说明:类的基本使用示例代码:// Class.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <sstream>#include <string>using namespace std;class Student{public: Stude...
2018-04-05 00:27:26 170
原创 Structs
内容:说明:结构体的基本使用示例代码:// Structs.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <string>using namespace std;struct Student{ int age; string fName; st...
2018-04-04 23:55:46 852
原创 Strings
内容:说明:string字符串方法简单使用示例代码:// Strings.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <string>using namespace std;//by zhaoclint main(){ string a, b; /...
2018-04-04 23:44:05 550
零基础学小程序开发.docx
2020-07-15
MFC最全ToolTip例子+源文件
2018-12-07
Duilib学习大全(简单实例、入门教程、相关工具等)
2018-05-14
MFC.Windows程序设计(第二版)(示例源码、电子书、安装包等全部)
2018-04-28
纯C实现语音合成(支持windows和linux),亲测可用(看评论酌情下载)
2018-02-08
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人