定义可变参数如果想让一个函数能接受任意个参数,我们就可以定义一个可变参数:def fn(*args): print args#coding=gbkdef kebian(*arg): return arg print(kebian(1))print(kebian('Str'))print(keb...
分类:
编程语言 时间:
2014-10-23 19:10:57
阅读次数:
245
1. if(i>str;string转intstd::string str = "123";int n = atoi(str.c_str());#include "stdafx.h"#include #include using namespace std;void main(){ //...
分类:
编程语言 时间:
2014-10-23 19:02:09
阅读次数:
166
简要:很多时候中奖用户并不希望让别人知道他的ID。程序中我们就将他们的账号部分设置为*号显示。
例如:王小二->王*二;
asadjsahd->a*********d;
代码:#include
#include
#define toStar(str,start,end) do{ for(int i=start;i<end;i++) { str[i] = '*...
分类:
编程语言 时间:
2014-10-23 16:27:18
阅读次数:
156
1、单元格超过部分省略号显示:if (e.Row.RowType == DataControlRowType.DataRow)//数据行{ string Str = e.Row.Cells[1].Text; //第二列内容 if (Str.Length > 45) //第二列内容大于20...
分类:
其他好文 时间:
2014-10-23 15:46:53
阅读次数:
161
题目大意:手上有5张牌, 堆上有5张牌, 现在要求舍弃手上的n(0 2 #include 3 #include 4 #include 5 #include 6 #include 7 char str[15][5]; 8 char sub[8][5]; 9 bool mark...
分类:
其他好文 时间:
2014-10-23 14:14:52
阅读次数:
225
很多时候我们正则清除HTML标签但总希望保留其中一部分标签
用asp语言实现
str="a.htmafefefeaabbb
ggg测试"
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="())[^>]*>)"
str=re.replace(str," ")
res...
分类:
Web程序 时间:
2014-10-23 12:25:44
阅读次数:
183
1 int main()2 {3 string str("Hello World!\n");4 cout 02 #include 03 04 int main()05 {06 size_t indexs = -1;07 size_t ps = 100;08 i...
分类:
编程语言 时间:
2014-10-23 10:36:16
阅读次数:
288
一、泛型接口
interface Inter{
public void show(T t);
}
class InterImple implements Inter{//知道是字符串类型
public void show(String str){
System.out.println("show "+str);
}
}
class InterImple_2 implements Int...
分类:
编程语言 时间:
2014-10-23 06:50:07
阅读次数:
273
python中r的用法,r'str'表示raw string,既忽略转义字符。因为和windows不一样,python中认为\就是转义字符escape sequences的标志。在python2.x中,unicode字符串需要在字符串前加u来表示,比如 str=u'汉字'而在python3.x中,u...
分类:
编程语言 时间:
2014-10-22 23:27:18
阅读次数:
270
valstr="aaaaaababbc"
valmiddData=List(("a",1),("a",12),("b",3),("c",1),("b",1))
/*
*wordcount
*/
str.split("").groupBy(x=>x).map(x=>x._1->x._2.size)
/*
result:scala.collection.immutable.Map[String,Int]=Map(a->2,b->1,c->1,aa->1,bb->1..
分类:
其他好文 时间:
2014-10-22 18:34:45
阅读次数:
248