本人的做法是转化成vector再处理,各种情况就比较简单了。class Solution {public: int compareVersion(string version1, string version2) { vector v1 = convert(version1); ...
分类:
其他好文 时间:
2015-01-01 00:03:30
阅读次数:
192
Compare two strings A and B, determine whether A contains all of the characters in B.The characters in string A and B are all Upper Case letters.Examp...
分类:
其他好文 时间:
2014-12-31 08:42:03
阅读次数:
228
Compare two version numbers version1 and version1.If version1 > version2 return 1, if version1 num2?1:-1; } return 0; }
这个题有意思的在于统一化的处理
先在串尾加顿号,这样每次都可...
分类:
其他好文 时间:
2014-12-29 13:42:35
阅读次数:
155
题目:
Compare two version numbers version1 and version1.
If version1 > version2 return 1, if version1 version2 return -1, otherwise return 0.
You may assume that the version strings are non-emp...
分类:
编程语言 时间:
2014-12-29 12:11:35
阅读次数:
320
使用 array_udiff ,array_uintersect来处理两个集合数据class Compare{ public function getToAddItems($a, $b){ return array_udiff($a,$b,array($this,"toCmp")) }...
分类:
其他好文 时间:
2014-12-27 13:55:40
阅读次数:
142
Compare two version numbers version1 and version1.
If version1 > version2 return 1, if version1 version2 return -1, otherwise return 0.
You may assume that the version strings are non-empty and co...
分类:
其他好文 时间:
2014-12-27 09:01:59
阅读次数:
150
Compare two version numbersversion1andversion1.Ifversion1>version2return 1, ifversion1=ver2.length){ maxlength=ver1.length; } else{ ...
分类:
其他好文 时间:
2014-12-26 14:17:47
阅读次数:
175
http://winmerge.org/about/WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presentin...
题目:从考试成绩中划出及格线
10个学生考完期末考试评卷完成后,A老师需要划出及格线,要求如下:
(1) 及格线是10的倍数;
(2) 保证至少有60%的学生及格;
(3) 如果所有的学生都高于60分,则及格线为60分
输入:输入10个整数,取值0~100
输出:输出及格线,10的倍数
#include
#include
int compare...
分类:
其他好文 时间:
2014-12-25 10:03:05
阅读次数:
161
不可变的 NSArray *arr= @[@"1",@"2",@"3"]; arr =[arr sortedArrayUsingSelector:@selector(compare:)]; NSLog(@"%@",arr); arr= [arr sortedArra...
分类:
编程语言 时间:
2014-12-24 23:55:05
阅读次数:
168