码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
如何提取浮点数的整数以及小数部分
#include?<stdio.h> #include?<math.h> float?fVal; float?fDecimal; int?iInteger; //iInteger?=?(fVal?*?10)?/?10; //fDecimal?=?fVal?-?iInteger int?main() { ????while(EOF?!=?scanf...
分类:其他好文   时间:2014-07-29 16:18:39    阅读次数:386
常用JS验证函数总结
/** ?* 检查输入的一串字符是否全部是数字 ?* 输入:str ?字符串 ?* 返回:true 或 flase; true表示为数字 ?*/ function checkNum(str){ ? ? return str.match(/\D/) == null; } /** ?* 检查输入的一串字符...
分类:Web程序   时间:2014-07-29 16:12:39    阅读次数:216
1-9.c
/*多个空格只输出一个*/ #include<stdio.h> int?main(void) { ????char?sucker,?spoon,?chopstick; ????sucker?=?spoon?=?chopstick?=?‘\0‘; ????while((sucker=getchar())!=EOF){ ????...
分类:其他好文   时间:2014-07-29 16:10:09    阅读次数:190
适配器模式
classerrorObject{public$error;publicfunction__construct($error){$this->error=$error;}publicfunctiongetError(){return$this->error;}}classlogToConsole{private$_errorObject;publicfunction__construct($_errorObject){$this->_errorObject=$_errorObject;}pu..
分类:其他好文   时间:2014-07-29 15:47:29    阅读次数:161
C 语言 整理 10
//#import与#include相比能够防止重复导入,保证内容值只复制一个.//#include"A.h"//#include"A.h"//多个include修改如下:#ifndeflessonPointHigher_A_h#definelessonPointHigher_A_hintmax(intx,inty){returnx>y?x:y;}#endif//宏,只做替换//#开头指令//命名规则:1.全大写2.k..
分类:其他好文   时间:2014-07-29 15:39:59    阅读次数:184
扩展欧几里得
欧几里德算法又称辗转相除法,用于计算两个整数a,b的最大公约数。 基本算法:设a=qb+r,其中a,b,q,r都是整数,则gcd(a,b)=gcd(b,r),即gcd(a,b)=gcd(b,a%b)。 递归代码: __int64 gcd(__int64 a,__int64 b) { return b==0?a:gcd(b,a%b); } 扩展欧几里得 基本...
分类:其他好文   时间:2014-07-29 15:00:38    阅读次数:431
python3.x的异常处理
以前的python2.x的时候: try:         fp=urllib.request.urlopen(blogurl)     except Exception, e:         print (e)         print('download exception %s' % blogurl)         return 0   现在python3.x的时候: ...
分类:编程语言   时间:2014-07-29 14:58:28    阅读次数:279
hdu 4883 TIANKENG’s restaurant
//暴搜 # include # include # include using namespace std; struct node { int b; int e; int num; }; struct node a[10010]; int cmp(node a1,node a2) { return a1.b<a2.b; } int main() {...
分类:其他好文   时间:2014-07-29 14:48:08    阅读次数:158
android获取sd卡路径方法
public String getSDPath(){File sdDir = null;boolean sdCardExist = Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED); ...
分类:移动开发   时间:2014-07-29 13:51:28    阅读次数:228
[LeetCode] Palindrome Partitioning II (DP)
Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ...
分类:其他好文   时间:2014-07-29 13:43:58    阅读次数:223
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!