码迷,mamicode.com
首页 >  
搜索关键字:ret    ( 30742个结果
OpenCV -- 获取轮廓照片
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
c语言实现猜数字小游戏
#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函数为: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
C语言编写猜数字的小游戏
#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
iOS笔试选择题
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
[LeetCode]Copy List with Random Pointer
第一个是用了hashmap, 第二个是在每个public class Solution { public RandomListNode copyRandomList(RandomListNode head) { if (head == null) { ret...
分类:其他好文   时间:2015-12-02 16:12:40    阅读次数:138
字符串函数汇总2
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
[LeetCode]题解(python):035-Search Insert Position
题目来源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
iOS 文件大小转换成 KB、MB、GB 。。。
-(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
LeetCode "Sparse Matrix Multiplication"
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!