字符串的操作1.去除字符串的首尾空格和特殊字符 函数trim() 用于去除开始位置以及结束位置的字符 语法 string trim(string str[, string charlist]),其中charlist是可选参数,指定删除的字符串,携带的话,删除指定的字符,如果不携带的话,...
分类:
Web程序 时间:
2015-05-09 11:29:33
阅读次数:
115
1 public static void main(String[] args) { 2 double n = 1, sum = 0; 3 while (n <= 20) { 4 sum += 1 / Factorial(n); 5 ...
分类:
编程语言 时间:
2015-05-09 11:28:18
阅读次数:
121
随机抽奖程序 string[] s = new string[] { "A", "B", "C", "D", "E", "F", "G" }; Random rand = new Random(); for (int i = 0; i < 50; i++) ...
分类:
其他好文 时间:
2015-05-09 11:26:31
阅读次数:
109
1 public static void main(String[] args) { 2 int triangle[][] = new int[10][];// 创建二维数组 3 // 遍历二维数组的第一层 4 for (int i = 0; i <...
分类:
编程语言 时间:
2015-05-09 10:09:44
阅读次数:
126
1 public class Test02 { 2 public static void main(String[] args) { 3 for (int i = 1; i <= 9; i++) { 4 for (int j = 1; j <= i;...
分类:
编程语言 时间:
2015-05-09 10:04:00
阅读次数:
125
Controller Node:安装认证服务:1. sudo apt-get install keystone2. sudo vi /etc/keystone/keystone.conf[database]# The SQLAlchemy connection string used to conn...
分类:
其他好文 时间:
2015-05-09 10:02:43
阅读次数:
125
Implement atoi to convert a string to an integer.
Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca...
分类:
其他好文 时间:
2015-05-09 08:56:30
阅读次数:
104
题意:有n个结点,给出了q个操作,操作是a b string表示结点a到结点b的和是奇数或偶数,输出x(前x个操作都是正确的)。
题解:带权并查集经典题,因为结点可能有10,000,000,000个,所以需要离散化,不用的点就不考虑了。因为要a加到b,如果a==b无法找到各自的根节点并判断是否要合并,所以其实是mp[a - 1]到mp[b]并入集合。另外需要注意结点是有顺序的,父亲结点要大于等于子...
分类:
其他好文 时间:
2015-05-09 08:53:18
阅读次数:
116
os模块包含操作系统功能,类似unix c的api。主要包含:def ctermid(): """Return the filename corresponding to the controlling terminal of the process. :rtype: string...
分类:
其他好文 时间:
2015-05-09 08:49:14
阅读次数:
175
packagepy.db.com;
importjava.sql.Connection;
importjava.sql.DriverManager;
importjava.sql.SQLException;
importjava.sql.Statement;
importcom.mysql.jdbc.PreparedStatement;
publicclassDB_update{
publicstaticvoidmain(String[]args){
//TestUpdate();
Te..
分类:
数据库 时间:
2015-05-09 06:39:51
阅读次数:
173