码迷,mamicode.com
首页 >  
搜索关键字:int    ( 143001个结果
C语言,如何检查文件是否存在和权限的信息
按功能access,头文件io.h(linux通过使用unistd.h int access(const char *filename, int amode);amode參数为0时表示检查文件的存在性,假设文件存在。返回0。不存在,返回-1。这个函数还能够检查其他文件属性:06 检查读...
分类:编程语言   时间:2015-07-11 13:29:59    阅读次数:184
islower||isdigit||isupper
相关函数isalpha,isupper表头文件#include定义函数int islower(int c)函数说明检查参数c是否为小写英文字母。返回值若参数c为小写英文字母,则返回TRUE,否则返回NULL(0)。附加说明此为宏定义,非真正函数。1 #include2 main()3 {4 char...
分类:其他好文   时间:2015-07-11 13:29:10    阅读次数:81
LeetCode Maximum Depth of Binary Tree (求树的深度)
题意:给一棵二叉树,求其深度。思路:递归比较简洁,先求左子树深度,再求右子树深度,比较其结果,返回:max_one+1。 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int val; 5 ...
分类:其他好文   时间:2015-07-11 13:25:41    阅读次数:125
vijos 1037 ***
链接:点我 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const int v = 2000 + 5; 7 const int MaxN = 100 + 5; 8 int N, sum, num[M...
分类:其他好文   时间:2015-07-11 13:23:48    阅读次数:113
数组根据index拆分和查询下标
private class ArrayTool { /// 查询值在数组中的下标 /// 数组 /// 查询的参数 /// 下标 public static int ArrayQueryIndex(T[] array, T...
分类:编程语言   时间:2015-07-11 13:22:02    阅读次数:125
第一种并查集
/** 4 2 1 3 4 3 0 1 2 3 4 0 1 2 1 3 */ #include #include #include using namespace std; int Set[1010]; int M,N; void Mergel(int a,int b){ int i=min(a,b); int j=max(a,b); for(int k=1;k<=N;k+...
分类:其他好文   时间:2015-07-11 12:12:51    阅读次数:95
第二种并查集
#include #include using namespace std; int Set[1000]; void merge2(int a,int b) { if(a<b) Set[b]=a; else Set[a]=b; } int find2(int x) { int r=x; while(Set[r]!=r) r=Set[r]; return r;...
分类:其他好文   时间:2015-07-11 12:11:01    阅读次数:106
3.PHP自定义错误处理器
1. 使用set_error_handler 自定义错误处理函数说明 1.创建错误处理函数 2.设置不同级别调用函数 3.set_error_handler函数指定接管错误处理 set_error_handler 说明mixed set_error_handler ( callable $error_handler [, int $error_types = E_ALL |...
分类:Web程序   时间:2015-07-11 12:10:51    阅读次数:144
POJ-1007
#include #include #include using namespace std; int inversionCompute(string str){ int inversionSum=0; char *cp=(char*)str.data(); for(int i=0;i<str.length()-1;i++){ for(int j=i;j<str.length()-1;...
分类:其他好文   时间:2015-07-11 12:10:23    阅读次数:105
vijos 1028 LIS *
链接:点我 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 #define MOD 100000000710 const int INF=0x3...
分类:其他好文   时间:2015-07-11 11:57:40    阅读次数:132
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!