写在前面

今天第一次成功搭建了博客,真的非常开心。

我在寒假就曾经尝试过搭建,但是当时遇到了一些error,有些畏难情绪,便放弃了,今天突然想再试试,结果还挺顺利的,这篇文章得以出现在你们眼前。

我希望通过这个博客,多多输出自己的一些想法吧,像是维持稳态一样,人总是要保持输入输出平衡的,只有在输出的时候才会进行更多深入的思考,大概如此吧。

可能没什么人看,但只要自己能看到就好啦,希望每一天都能开心,尽力做到想做的事情。

我在博客主页放了一些好听的音乐,希望你们喜欢,那就到这啦。

ψ(`∇´)ψ

写在最后

因为以后的大部分内容可能跟代码有关,因此在这里测试一下显示效果

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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package IntList;

public class IntList {
public int first;
public IntList rest;

public IntList(int f, IntList r) {
first = f;
rest = r;
}

/** Return the size of the list using... recursion! */
public int size() {
if (rest == null) {
return 1;
}
return 1 + this.rest.size();
}

/** Return the size of the list using no recursion! */
public int iterativeSize() {
IntList p = this;
int totalSize = 0;
while (p != null) {
totalSize += 1;
p = p.rest;
}
return totalSize;
}

/** Returns the ith item of this IntList. */
public int get(int i) {
if (i == 0) {
return first;
}
return rest.get(i - 1);
}

/** Method to return a string representation of an IntList */
public String toString() {
if (rest == null) {
// Converts an Integer to a String!
return String.valueOf(first);
} else {
return first + " -> " + rest.toString();
}
}

/**
* Method to create an IntList from an argument list.
* You don't have to understand this code. We have it here
* because it's convenient with testing. It's used like this:
*
* IntList myList = IntList.of(1, 2, 3, 4, 5);
* will create an IntList 1 -> 2 -> 3 -> 4 -> 5 -> null.
*
* You can pass in any number of arguments to IntList.of and it will work:
* IntList mySmallerList = IntList.of(1, 4, 9);
*/
public static IntList of(int ...argList) {
if (argList.length == 0)
return null;
int[] restList = new int[argList.length - 1];
System.arraycopy(argList, 1, restList, 0, argList.length - 1);
return new IntList(argList[0], IntList.of(restList));
}
}

那就祝大家晚安啦!