Se7en's Blog|Learn and live

初涉正则表达式

RX

最近总是看到有人问正则表达式匹配特定字符串之类的问题,才发现自己之前一直忽略了这个东西,而且群里发出来的正则语句完全看不懂,感觉挺有意思的,以后应该也会用得到。

HTML 速查列表

HTML

HTML 基本文档

1
2
3
4
5
6
7
8
9
<!DOCTYPE html>
<html>
<head>
<title>文档标题</title>
</head>
<body>
可见文本...
</body>
</html>
Java冒泡排序算法
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
public class Maopao {
public void bigAndSmall(){
int arr[] = {-1,3,6,7,0,12,35,5,4,666};
/*根据数组的长度循环遍历,并判断如果前一个值小于后一个值,
那么就把“后一个值”排列到“当前前一个值”的前面。*/
for (int i=1;i<arr.length;i++){
System.out.println("当i="+i+"时:");
for (int j=0;j<arr.length-i;j++){
if (arr[j]<arr[j+1]){
int temp;
temp = arr[j];
arr[j] = arr[j+1];
arr[j+1] = temp;
}
System.out.println("当j="+j+"时:"+arr[0]+","+arr[1]+","+arr[2]+","+arr[3]+","+arr[4]+","+arr[5]+","+arr[6]+","+arr[7]+","+arr[8]+","+arr[9]);
}
System.out.println("FOR循环结果为:"+arr[0]+","+arr[1]+","+arr[2]+","+arr[3]+","+arr[4]+","+arr[5]+","+arr[6]+","+arr[7]+","+arr[8]+","+arr[9]);
System.out.println("____________________________________");
}
for (int i=0;i<arr.length;i++){
System.out.println(arr[i]);
}
}
public static void main(String args[]){
//main函数中,通过实例化别名点方法名的方式调用并打印出结果
Maopao mp = new Maopao();
mp.bigAndSmall();
}
}