1、类型兼容规则是指在需要基类对象的任何地方,都可以使用公有派生类的对象来替代。通过公有继承,派生类得到了基类中除构造函数、析构函数之外的所有成员。这样公有派生类实际就具备了基类的所有功能,凡是基类能解决的问题,公有派生类都可以解决。类型兼容规则中所指的替代包括以下的情况: a、派生类的对象可以赋值 ...
分类:
其他好文 时间:
2016-12-29 17:18:00
阅读次数:
256
http://poj.org/problem?id=2065 (题目链接) 题意 题意半天看不懂。。给你一个素数P(P<=30000)和一串长为n的字符串str[]。字母'*'代表0,字母a-z分别代表1-26,这n个字符所代表的数字分别代表f(1)、f(2)....f(n)。定义: ${f(k)= ...
分类:
其他好文 时间:
2016-12-29 16:48:43
阅读次数:
154
1、公有继承 当类的继承方式为公有继承时,基类的公有和保护成员的访问属性在派生类中不变,而基类的私有成员不可直接访问。 也就是说基类的公有成员和保护成员被继承到派生类中访问属性不变,仍作为派生类的公有成员和保护成员,派生类的其他成员可以直接访问他们。在类族之外只能通过派生类的对象访问从基类继承的公有 ...
分类:
其他好文 时间:
2016-12-29 14:35:45
阅读次数:
275
A.txt A1 10.5318295 10.99222177 11.03562467 10.96557789 10.83035429A2 6.739434821 7.116196513 6.580855876 6.373403461 6.171394699A3 8.211470461 7.4081 ...
分类:
其他好文 时间:
2016-12-29 11:04:23
阅读次数:
202
#include #include #include using namespace std; int countA=0; int countB=0; int countC=0; int countD=0; int countE=0; int countError=0; int countPriva... ...
分类:
其他好文 时间:
2016-12-29 07:42:45
阅读次数:
196
#include<iostream> #include<vector> #include<string> void main() { using namespace std; class Solution { public: string convert(string s, int numRows) ...
分类:
其他好文 时间:
2016-12-29 07:42:05
阅读次数:
142
给定一个l×w的矩形,和n个圆,求最小的k使得每个圆的半径×k后,能覆盖整个矩形. ...
分类:
其他好文 时间:
2016-12-28 23:31:51
阅读次数:
358
使用dynamic获取类型可变的json对象 Dictionary<string, object> dict = new Dictionary<string, object>(); List<dynamic> lst = new List<dynamic>() { new { aa = 1, bb ...
分类:
Web程序 时间:
2016-12-28 07:48:32
阅读次数:
168
#include int main() { while (1) { using namespace std; cout << "helloword"; cout << endl; } return 0; } ...
分类:
编程语言 时间:
2016-12-28 01:57:11
阅读次数:
138
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3318 题意:给一个深度不超过16的二叉树,代表一个天平。每根杆悬挂在中间,每个秤砣的重量已知,至少修改多 ...
分类:
其他好文 时间:
2016-12-27 23:09:36
阅读次数:
222