码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
python ConfigParser例子02
#coding:utf-8importConfigParserclassConf():def__init__(self,name):self.name=nameself.cp=ConfigParser.ConfigParser()self.cp.read(name)defgetSections(se...
分类:编程语言   时间:2014-07-29 11:25:16    阅读次数:290
Letter Combinations of a Phone Number
这是一个循环操作,如果重数太多,只能递归搜索,不满足条件return 或者else,刚才出错了public class Solution { private String letters[] = {"","","abc", "def", "ghi", "jkl", "mno", "pqr...
分类:其他好文   时间:2014-07-29 11:08:26    阅读次数:233
指针要灵活用
#includeint main(){ int a = 5,b = 3; printf(&a["Ya!Hello!How is this?\n"],&b["junke/super"]); return 0;}
分类:其他好文   时间:2014-07-29 11:03:56    阅读次数:176
[LeetCode 题解]: Merge k Sorted Lists
Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.题意:对k个有序的链表进行归并排序。并分析其复杂度。/** * Definition for singly-...
分类:其他好文   时间:2014-07-29 11:02:16    阅读次数:205
数字跟问题
问题描述: 数字根是指对一个整数,把它的各位数字相加,若其和为一位数,则此和即为其根,若不是一位数字,则把它的各位数字继续相加,直到其和为一个正整数为止。例如对于正整数24,因为2+4=6,和为1位数,所以6即为其根。对于39,因为3+9=12,和不为个位数,继续相加,1+2=3,3为个位数,则为数...
分类:其他好文   时间:2014-07-29 10:59:36    阅读次数:228
并查集(2)-按秩合并和路径压缩
在上面一讲是并查集(1)-判断无向图是否存在环. 我们使用了并查集的两个操作:union()和find()// find 的原始实现int find(int parent[], int i){ if (parent[i] == -1) return i; return f...
分类:其他好文   时间:2014-07-29 10:57:16    阅读次数:266
Topcoder 多校T-shirt场
盗用名字:C题题目都没看懂, B:You are given a long longn. Return the largest divisor ofnthat is a perfect square. That is, the correct return value is x if and ...
分类:其他好文   时间:2014-07-29 10:54:36    阅读次数:204
hdoj 2057
代码:#include #includeint main(){__int64 a,b,c;while(scanf("%I64X%I64X",&a,&b)!=EOF){ c=a+b; if(c<0){printf("-"); c=-c;}printf("%I64X\n",c);}return 0;}无...
分类:其他好文   时间:2014-07-29 10:36:06    阅读次数:228
算法总结之欧几里德算法
算法总结之欧几里德算法1.欧几里德算法 欧几里德算法又称辗转相除法,用于计算两个正整数a,b的最大公约数。 其计算原理依赖于下面的定理: gcd(a,b)=gcd(b,amodb)(a>b且amodb不为0)代码实现:1 int gcd(int a,int b)2 {3 return ...
分类:其他好文   时间:2014-07-29 10:29:16    阅读次数:231
南阳理工另一种阶乘问题
#includeint main(){ int n,m; int sum,i; int a[21]; int t=1,t1=1; for(i=1;i<21;i=i+2) { a[i]=t*t1; a[i+1]=a[i]; t=t1*t; t1=t1+2; } scanf("%...
分类:其他好文   时间:2014-07-28 23:35:34    阅读次数:187
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!