码迷,mamicode.com
首页 >  
搜索关键字:pascals triangle    ( 1342个结果
第十三周项目二-形状类族中的纯虚函数
写一个程序,定义抽象基类Shape,由它派生出3个派生类,Circle(圆形)、Rectangle(矩形)、Triangle(三角形)。用如下的main()函数,求出定义的几个几何体的面积和。  int main() { Circle c1(12.6),c2(4.9);//建立Circle类对象c1,c2,参数为圆半径 Rectangle r1(4.5,8.4),r2(5.0,2...
分类:其他好文   时间:2015-06-08 09:57:55    阅读次数:109
第十三周项目2-形状类族的中的纯虚函数
写一个程序,定义抽象基类Shape,由它派生出3个派生类,Circle(圆形)、Rectangle(矩形)、Triangle(三角形)。用如下的main()函数,求出定义的几个几何体的面积和。 int main() { Circle c1(12.6),c2(4.9);//建立Circle类对象c1,c2,参数为圆半径 Rectangle r1(4.5,8.4),r2(5.0,...
分类:其他好文   时间:2015-06-07 12:39:21    阅读次数:103
Leetcode: Triangle
最近都在复习英语,看见看得头都大了,而且阅读越做分数越低!换个环境,做做Leetcode试题! 题目: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, g...
分类:其他好文   时间:2015-06-07 12:35:49    阅读次数:110
LeetCode 118:Pascal's Triangle
Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5, Return [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ] class Solution { publi...
分类:其他好文   时间:2015-06-06 09:09:09    阅读次数:92
LeetCode 119:Pascal's Triangle II
Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3,3,1]. 题目要求计算杨辉三角某一行的元素,这个也是二项式系数的计算问题。 class Solution { public: vector getRow(int row...
分类:其他好文   时间:2015-06-06 09:08:37    阅读次数:114
Project Euler:Problem 42 Coded triangle numbers
The nth term of the sequence of triangle numbers is given by, tn = ½n(n+1); so the first ten triangle numbers are: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... By converting each letter in a word to a...
分类:其他好文   时间:2015-06-05 12:29:01    阅读次数:128
Project Euler:Problem 39 Integer right triangles
If p is the perimeter of a right angle triangle with integral length sides, {a,b,c}, there are exactly three solutions for p = 120. {20,48,52}, {24,45,51}, {30,40,50} For which value of p ≤ 1000, is...
分类:其他好文   时间:2015-06-04 11:47:49    阅读次数:107
第13周 【项目2-形状类族的中的纯虚函数】
问题描述: 写一个程序,定义抽象基类Shape,由它派生出3个派生类,Circle(圆形)、Rectangle(矩形)、Triangle(三角形)。用如下的main()函数,求出定义的几个几何体的面积和。  int main() { Circle c1(12.6),c2(4.9);//建立Circle类对象c1,c2,参数为圆半径 Rectangle r1(4.5...
分类:其他好文   时间:2015-06-03 09:51:26    阅读次数:104
??项目2-形状类族中的纯虚函数
项目2-形状类族的中的纯虚函数 写一个程序,定义抽象基类Shape,由它派生出3个派生类,Circle(圆形)、Rectangle(矩形)、Triangle(三角形)。用如下的main()函数,求出定义的几个几何体的面积和。  int main() { Circle c1(12.6),c2(4.9);//建立Circle类对象c1,c2,参数为圆半径 Rectan...
分类:其他好文   时间:2015-06-03 09:47:23    阅读次数:107
Solution to Triangle by Codility
question: https://codility.com/programmers/lessons/4 we need two parts to prove our solution. on one hand, there is no false triangular. Given the array has been sorted, if A[i]+A[i+1]>A[i+2]...
分类:其他好文   时间:2015-06-02 23:32:26    阅读次数:361
1342条   上一页 1 ... 83 84 85 86 87 ... 135 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!