代码:#include #include int main(){ int t; while(scanf("%d",&t)!=EOF) { while(t--) { __int64 n; scanf("%I64d",&n); double x=n*log10(n*1.0); x-=(__int64)x...
分类:
其他好文 时间:
2014-07-29 12:34:57
阅读次数:
229
题目:Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.题解:这道题看所给的字符串数组里面有多少个是同一个变形词变的。这道....
分类:
编程语言 时间:
2014-07-29 12:17:46
阅读次数:
267
#include#includeint main(){ int t,h; int n; double n1; scanf("%d",&t); while(t--) { n=0; scanf("%d",&h); if(h10) { n1=(h-10...
分类:
其他好文 时间:
2014-07-29 12:15:06
阅读次数:
238
/* 1.是否以某字符串结尾 endsWith(theStr,endStr) @param theStr:要判断的字符串 @param endStr:以此字符串结尾 @return boolean;*/function endsWith...
分类:
编程语言 时间:
2014-07-29 12:06:36
阅读次数:
304
乐趣在于发现。编程最大的乐趣在于编写自己的函数使用C++函数步骤:1.函数定义2.函数原型 3.调用函数函数分为两类:有返回值和没有返回值的函数。void函数表示没有返回值void funcitonName(parameterList){statement(s)return;} #include ....
分类:
其他好文 时间:
2014-07-29 12:00:56
阅读次数:
201
#include using namespace std;void f(int x){ if(x>x; f(x); return 0;}View Code#include using namespace std;void f(int x){if(x>x; f(x);ret...
分类:
其他好文 时间:
2014-07-29 11:46:56
阅读次数:
221
1.$.isWindow 判断是不是window对象var isWindow = function(obj){ return obj != null && obj == obj.window;//window对象有个window属性指向自己 }2.isArraylike 判断一个对...
//贪心算法解决加油站选择问题//# include# includeusing namespace std;# includestruct Node{ float p, d;};bool cmp(Node a, Node b){ return a.d > Cmax >> D >> Da...
分类:
其他好文 时间:
2014-07-29 11:36:46
阅读次数:
268
/*C++HelloWorld**/#include#includeintmain(){printf("HelloWorld");//2000年我上大学的课本写法puts("Hi");//只用来输出字符串,没有格式控制puts("hi""greatverve""ok");//直接连接字符串std::...
分类:
编程语言 时间:
2014-07-29 11:30:36
阅读次数:
228
string1 = ''''' the stirng Has many line In THE fIle ''' list_of_string = string1.split() print list_of_string #将字符串分离开,放入列表中 print '*'*50 ...
分类:
其他好文 时间:
2014-07-29 11:25:26
阅读次数:
211