码迷,mamicode.com
首页 >  
搜索关键字:input    ( 33491个结果
[leetcode] Reverse Words in a String
Given an input string, reverse the string word by word.
分类:其他好文   时间:2014-07-08 22:41:34    阅读次数:187
HDU-1255-覆盖的面积(线段树)
Problem Description 给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积.   Input 输入数据的第一行是一个正整数T(1 注意:本题的输入数据较多,推荐使用scanf读入数据.   Output 对于每组测试数据,请计算出被这些矩形覆盖过至少两次的区域的面积.结果保留两位小数.   Sample Inpu...
分类:其他好文   时间:2014-07-08 21:41:49    阅读次数:274
计数排序、基数排序与桶排序
一、计数排序 稳定、 当输入的元素是n 个小区间(0到k)内整数时,它的运行时间是 O(n + k),空间复杂度是O(n)。 const int K = 100; //计数排序:假设输入数据都属于一个小区间内的整数,可用于解决如年龄排序类的问题 //Input:A[0, ..., n-1], 0 <= A[i] < K //Output:B[0, ..., n-1], sorting of A...
分类:其他好文   时间:2014-07-08 21:24:36    阅读次数:232
LeetCode——Regular Expression Matching
Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the preceding element. The matching should cover the entire input st...
分类:其他好文   时间:2014-07-08 16:57:40    阅读次数:193
用递归翻转一个栈 Reverse a stack using recursion
明确递归语句之前的语句都是顺序执行,而递归语句之后的语句都是逆序执行package recursion; import java.util.Stack; public class Reverse_a_stack_using_recursion { /* Input stack: 3 2 1 Output stack: 1 2 3 */ public s...
分类:其他好文   时间:2014-07-08 13:39:49    阅读次数:143
LeetCode——String to Integer (atoi)
Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca...
分类:其他好文   时间:2014-07-08 12:52:05    阅读次数:200
华为OJ:2290 字符串最后一个单词的长度
用JAVA就很简单,只要用spilt函数,再输出最后一个字符串。 题意是要求你先自己写分隔好字符串这样子。有个比较坑的地方就是测试用例应该有个全为空的,要注意。 import java.util.Scanner; public class Main { public static void main(String args[]){ Scanner input=new Scanner(...
分类:其他好文   时间:2014-07-08 11:13:38    阅读次数:275
用Javascript清空(重置)文件类型的INPUT元素的值
因为安全限制,脚本不能随意设置文件域的value值,重置一个文件域的值,归纳起来主要有 3 种方法。本文分析这三种方法的浏览器兼容性以及优缺点,并给出一个比较完美的综合方案的代码和Demo。...
分类:编程语言   时间:2014-07-08 10:43:24    阅读次数:171
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".click to show clarification.Cl...
分类:其他好文   时间:2014-07-08 10:26:31    阅读次数:240
按字符出现频率对字符进行排序
#include<iostream> #include<string> #include<algorithm> usingnamespacestd; voidtongji() { stringinput; stringoutput; getline(cin,input);//读入带空格的字符串 intn; n=input.size();//求字符串的大小 inta[255]={0}; intb[255]={0}; bo..
分类:其他好文   时间:2014-07-08 09:16:59    阅读次数:218
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!