码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
leetcode-242-Valid Anagram
Valid Anagram    Given two strings s and t, write a function to determine if t is an anagram of s. For example, s = "anagram", t = "nagaram", return true. s = "rat", t = "car", return f...
分类:其他好文   时间:2015-08-01 22:03:13    阅读次数:83
[leedcode 151] Reverse Words in a String
Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".Update (2015-02-12):For C prog...
分类:其他好文   时间:2015-08-01 21:59:34    阅读次数:122
LeetCode#29 Divide Two Integers
Problem Definition:Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.Solution:就是要用加减和位操作之类...
分类:其他好文   时间:2015-08-01 21:58:41    阅读次数:98
Android 中保存数据到文件中
1、在安卓开发中,会遇到保存数据到手机中以及从手机中获取数据的情况/** * 把数据存放到手机内存中 * * @param number * @param password * @return */ public static boolean ...
分类:移动开发   时间:2015-08-01 21:58:33    阅读次数:447
【LeetCode】242. Valid Anagram (2 solutions)
Valid AnagramGiven two stringssandt, write a function to determine iftis an anagram ofs.For example,s= "anagram",t= "nagaram", return true.s= "rat",t=...
分类:其他好文   时间:2015-08-01 21:53:11    阅读次数:107
LeetCode#24 Swap Nodes in Pairs
Problem Definition:Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as...
分类:其他好文   时间:2015-08-01 21:50:14    阅读次数:110
树状数组
#include int A[15]={0,1,2,3,4,5,6,7,8,9,10}; int C[15]; int lowbit(int x) { return x&(-x); } int SUM(int n) { int sum=0; while(n>0){ sum = sum + C[n]; n = n - lowbit(n); ...
分类:编程语言   时间:2015-08-01 20:40:57    阅读次数:155
1-1 操作系统做了什么?
比如一个C程序helloworld执行的过程来看#include<stdio.h> intmain(intargc,char*argv[]) { puts{("helloworld"); return0; }第一步:用户:告诉操作系统执行helloworld程序(如何告知?)可能是命令行执行,双击图标等方法。第二步:1、操作系统:找到helloworld程序的相..
分类:其他好文   时间:2015-08-01 19:16:30    阅读次数:149
恶补c语言之strlen的实现
最近与同学交流c语言库函数的实现,发现自己所学的不能灵活运用,于是乎我就开启猛火力模式,先自己来实现下常见的库函数。strlen()函数说明返回指定字符串长度,不包括结束字符‘/0‘实现原型:intMyStrlen(constchar*str){intn;while(*str++!=‘\0‘)n++;returnn;}//以下函数为..
分类:编程语言   时间:2015-08-01 19:14:23    阅读次数:153
UVA10325--- The Lottery (容斥)
#include #include using namespace std; typedef long long LL; LL get[18]; LL gcd(LL m, LL n) { if(n == 0) return m; return gcd(n, m%n); }LL lcm(LL a, LL b) { LL t=gc...
分类:其他好文   时间:2015-08-01 19:00:55    阅读次数:90
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!