Longest Common Prefix
题目:
Write a function to find the longest common prefix string amongst an array of strings. 题意:
找出所有字符串的最长的公共前缀 思路:先找到最短的一个字符串,然后它的长度当作范围,接着判断所有字符串的同一个下标的字符,若全部相等则添加到返回字符...
分类:
其他好文 时间:
2015-05-31 14:06:39
阅读次数:
148
/*
* String(byte[] bytes, String charsetName):通过指定的字符集解码字节数组
* byte[] getBytes(String charsetName):使用指定的字符集合把字符串编码为字节数组
*
* 编码:把看得懂的变成看不懂的
* String -- byte[]
*
* 解码:把看不懂的变成看得懂的
* byt...
分类:
编程语言 时间:
2015-05-31 14:06:33
阅读次数:
171
import java.util.Scanner;
public class p1157 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int n = sc.nextInt();
if(n==0){
retu...
分类:
其他好文 时间:
2015-05-31 14:05:56
阅读次数:
150
/*ID: awsd1231PROG: gift1LANG: C++*/#include#include#include#includeusingnamespace std;map nameMoney;string sname[10];int main(){ freopen("gift1.in","...
分类:
其他好文 时间:
2015-05-31 13:54:36
阅读次数:
72
// 按单词读有误,读出来的和按行读效果一致。 1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 int fileToLineVector(const string fileN...
分类:
其他好文 时间:
2015-05-31 13:47:49
阅读次数:
112
switch中表达式的返回值是byte short char int 枚举 String中之一。case中的值必须为常量,并且case子句中的值是不同的。default是可选的,当case中没有匹配的值会跳转到default中break是执行完一个case语句后跳出switch循环语句。没有brea...
分类:
编程语言 时间:
2015-05-31 13:46:42
阅读次数:
161
当您在计算Money的时候,请看好了!!!要不损失了别后悔!!!现象1: public static void main(String[] args) { System.out.println(0.030*100);//输出3.0 System.out.println(0.031*100);//输出...
分类:
编程语言 时间:
2015-05-31 13:40:01
阅读次数:
134
由于对float或double 的使用不当,可能会出现精度丢失的问题。问题大概情况可以通过如下代码理解: [java] view plaincopyprint?publicclassFloatDoubleTest{publicstaticvoidmain(String[]args){floatf=2...
分类:
编程语言 时间:
2015-05-31 13:36:29
阅读次数:
133
Problem Description
You are given two strings s1[0..l1], s2[0..l2] and Q - number of queries.
Your task is to answer next queries:
1) 1 a i c - you should set i-th character in a-th string to c...
分类:
其他好文 时间:
2015-05-31 12:30:58
阅读次数:
131
//把相对路径变成绝对路径。string absolutePath = Server.MapPath(relativePath);FileUpload控件: 属性: FileName:文件名 HasFile:bool 是否选中了文件 FileBytes:要上传文件的二进制数据 方法: Sav...
分类:
Web程序 时间:
2015-05-31 12:19:17
阅读次数:
108