List<String>list=newArrayList<String>();
Calendarca=Calendar.getInstance(Locale.CHINESE);
intstart=ca.getFirstDayOfWeek();
intend=ca.getMaximum(Calendar.DAY_OF_WEEK);
for(inti=start;i<=end;i++){
ca.set(Calendar.DAY_OF_WEEK,i);
StringaString=c..
分类:
移动开发 时间:
2015-03-09 11:08:29
阅读次数:
146
问题描述:
对一个输入文本中的每个单词的出现次数统计,并选取出现频率最大的10个单词
#include
#include
#include string>
#include
#include
#include
using namespace std;
typedef pairstring, int> PAIR;
int cmp...
分类:
其他好文 时间:
2015-03-09 11:04:33
阅读次数:
119
11.String转int,即atoi函数实现。
主要考虑以下几种情况:
1. String为空
2. String中存在非数字字符,如空白字符,abcd等
3. String的正负
Code:
public class test {
public static int atoi(String str) {
if (str == null || st...
分类:
编程语言 时间:
2015-03-09 11:00:42
阅读次数:
175
/**
* 输出yes或no 用随机数产生两个数
*/
public class 送分啦 {
public static void main(String[] args) {
int n = (int) (Math.random() * 2 + 1);
if (n == 1)
System.out.println("yes");
else
System.out.pri...
分类:
其他好文 时间:
2015-03-09 10:56:06
阅读次数:
123
[引入using System.Diagnostics;using Microsoft.Win32;]#region 使用GZip压缩文件,返回bool值/// 要压缩的源文件名/// 压缩后的文件名/// 压缩后的成功类型public static bool GZipFile(string Fil...
分类:
其他好文 时间:
2015-03-09 10:37:38
阅读次数:
222
int compareVersion(string version1, string version2) {
stringstream s1(version1), s2(version2);
while(1){
int i1= 0, i2 = 0;
if(getline(s1, version1, '.')) //if读取成功,将字符串convert为整型
i1 = stoi(ver...
分类:
其他好文 时间:
2015-03-09 09:25:30
阅读次数:
158
二维数组计算最低值与最高值publicclassConutMark{publicstaticvoidmain(String[]args){//定义二维数组intgrades[][]={{77,68,86,73},{96,87,89,81},{70,90,86,81}};intlowGrade=grades[0][0];//定义保存最低分数的变量for(inti=0;i<grades.length;i++){//循环遍历数组for(i..
分类:
编程语言 时间:
2015-03-09 01:53:12
阅读次数:
197
当涉及到跨进程甚至是跨域传输数据的时候,我们需要把对象序列化和反序列化。 首先可以使用Serializable特性。 [Serializable] public class Person { public string _firstName; public string _secondName; /...
分类:
其他好文 时间:
2015-03-09 00:25:41
阅读次数:
122
一、单向多对一 举例:多个订单对应一个顾客 顾客类Customer.java:public class Customer{ private Integer customerId; private String customerName;//get() set() 省略} 订单类Or...
分类:
Web程序 时间:
2015-03-09 00:20:57
阅读次数:
236
DescriptionYou are given a string and supposed to do some string manipulations.InputThe first line of the input contains the initial string. You can a...
分类:
其他好文 时间:
2015-03-08 22:58:09
阅读次数:
697