import cv2img = cv2.imread( 'E:\A.jpeg' )cv2.imshow( 'img', img )gray = cv2.cvtColor( img, cv2.COLOR_BGR2GRAY )ret, binary = cv2.threshold( gray, 127,...
分类:
其他好文 时间:
2015-12-09 21:39:52
阅读次数:
1051
#include<stdio.h>#include<stdlib.h>#include<time.h>voidfun(intc){srand((unsigned)time(NULL));intret=rand()%100+1;printf("请输入一个数>");while(1){scanf("%d",&c);if(c==ret){printf("正确\n");break;}elseif(c>ret){printf("猜大了\n");..
分类:
编程语言 时间:
2015-12-09 20:03:34
阅读次数:
228
并差集是一个非常普通的模板,其中find函数为:find(int x){if(father[x]==x)return x;return find(father[x]);}但是今天发现了一个新的模板:int finds(int x){while(father[x]!=x)x=father[x];ret...
分类:
其他好文 时间:
2015-12-09 07:10:01
阅读次数:
120
#include<stdio.h>#include<stdlib.h>#include<time.h>intmain(){ intnum; srand((unsigned)time(NULL)); intret=rand()%100+1; while(1) { printf("请输入一个数字>>\n"); scanf("%d",&num); if(num>ret) printf("猜大了!"); if(num<..
分类:
编程语言 时间:
2015-12-08 07:16:28
阅读次数:
128
1-10 C语言 & 计算机基础1、请看下面一段代码static int a = 1;int main(){ int b = 2; char *c = NULL; c = (char *)malloc(100 * sizeof(char)); ret...
分类:
移动开发 时间:
2015-12-07 12:23:19
阅读次数:
522
第一个是用了hashmap, 第二个是在每个public class Solution { public RandomListNode copyRandomList(RandomListNode head) { if (head == null) { ret...
分类:
其他好文 时间:
2015-12-02 16:12:40
阅读次数:
138
memcpy内存拷贝函数,memcpy函数的功能是从源src所指的内存地址的起始位置开始拷贝n个字节到目标dest所指的内存地址的起始位置中。函数实现void*my_memcpy(void*buf1,constvoid*buf2,intcount)
{
assert(buf1);
assert(buf2);
void*ret=buf1;
char*dest=(char*)buf1;
char..
分类:
其他好文 时间:
2015-12-02 01:09:07
阅读次数:
146
题目来源https://leetcode.com/problems/search-insert-position/Given a sorted array and a target value, return the index if the target is found. If not, ret...
分类:
编程语言 时间:
2015-12-01 16:27:19
阅读次数:
169
-(NSString *) convertFileSize:(long long)size { long kb = 1024; long mb = kb * 1024; long gb = mb * 1024; if (size >= gb) { ret...
分类:
移动开发 时间:
2015-11-30 17:42:32
阅读次数:
155
Taking advantage of 'sparse'class Solution {public: vector> multiply(vector>& A, vector>& B) { vector> ret; int ha = A.si...
分类:
其他好文 时间:
2015-11-30 08:31:15
阅读次数:
389