码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
leetcode -- Add Binary
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".class Solution {public: string addBinary(str...
分类:其他好文   时间:2014-05-30 08:39:11    阅读次数:270
cocos2d 设置iphone竖屏
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return UIInterfaceOrientationIsPortrait(interfaceOrie...
分类:其他好文   时间:2014-05-30 08:10:40    阅读次数:228
VC获取文件后缀名
VC获取文件后缀名2011-07-28 10:30:50|分类: Visual C++ and O |标签: |举报 |字号大中小订阅1。 CString GetSuffix(CString strFileName) { return strFileName.Right(strFileName...
分类:其他好文   时间:2014-05-30 05:21:56    阅读次数:249
[leetcode]Subsets @ Python
原题地址:https://oj.leetcode.com/problems/subsets/题意:枚举所有子集。解题思路:碰到这种问题,一律dfs。代码:class Solution: # @param S, a list of integer # @return a list of l...
分类:编程语言   时间:2014-05-30 04:31:09    阅读次数:1243
leetcode -- Best Time to Buy and Sell Stock
class Solution {public: int maxProfit(vector &prices) { if(prices.size() == 0) return 0; vector f1(prices.size()); int minV = pri...
分类:其他好文   时间:2014-05-30 02:54:28    阅读次数:231
leetcode -- Best Time to Buy and Sell Stock II
class Solution {public: int maxProfit(vector &prices) { if(prices.size() == 0) return 0; vector f(prices.size()); f[0] = 0; ...
分类:其他好文   时间:2014-05-30 02:46:12    阅读次数:318
linux平台上面python调用c
不能免俗,先打印个helloworld出来,c代码的函数hello.c#include int helloworld(){ printf("hello world!"); return 0;}然后编译成动态链接库 gcc hello.c -fPIC -shared -o libhello...
分类:编程语言   时间:2014-05-30 02:08:52    阅读次数:467
Cocos2d-x游戏开发_战斗算法
我的战斗算法的核心代码private void aHitb(HeroBean a,HeroBean b){ ///*自身状态(已经移到aHitBTeam那里) //判断A能否出招或者受到伤害什么的 //*/ //if(this->checkStatus(a) == 1) // return...
分类:其他好文   时间:2014-05-29 21:57:43    阅读次数:322
排序算法----堆排序
堆排序算法使用二叉堆实现排序,树上的每一个节点对应数组中的一个元素。第一步:使用MAX_HEAPIFY维护一个最大堆(所有孩子节点都必须小于或等于其父节点)。它的输入为一个数组A和一下标i,调用MAX_HEAPIFY时,假设节点i的左右子树都是最大堆。伪码: 1 LEFT(i) 2 return.....
分类:其他好文   时间:2014-05-29 21:35:08    阅读次数:364
LeetCode ClimbingStairs
class Solution {public: int climbStairs(int n) { if (n < 1) return 0; int a = 0; int b = 1; for (int i=0; i<n; i++) { ...
分类:其他好文   时间:2014-05-29 20:23:07    阅读次数:339
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!