Skip to content

Commit 43e5411

Browse files
committed
更新资料
- 【面向对象程序设计(Java)】实验题目 及 部分题目参考代码
1 parent cc73d0c commit 43e5411

File tree

103 files changed

+2233
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+2233
-0
lines changed
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package Project_01.exercise_01;
2+
3+
public class Exercise_01 {
4+
public static void main(String[] args) {
5+
for (int i = 0; i < 5; i++) {
6+
System.out.println("Welcome to Java");
7+
}
8+
}
9+
}
13.1 KB
Loading
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package Project_01.exercise_02;
2+
3+
public class Exercise_02 {
4+
public static void main(String[] args) {
5+
System.out.println("a a^2 a^3");
6+
System.out.println("1 1 1");
7+
System.out.println("2 4 8");
8+
System.out.println("3 9 27");
9+
System.out.println("4 16 64");
10+
}
11+
}
26.6 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package Project_01.exercise_03;
2+
3+
public class Exercise_03 {
4+
public static void main(String[] args) {
5+
System.out.println("Result: " + ((9.5 * 4.5 - 2.5 * 3) / (45.5 - 3.5)));
6+
}
7+
}
34.9 KB
Loading
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package Project_01.exercise_04;
2+
3+
public class Exercise_04 {
4+
public static void main(String[] args) {
5+
int sum = 0;
6+
for (int i = 1; i <= 10; i++) {
7+
sum += i;
8+
}
9+
System.out.println(sum);
10+
}
11+
}
13.7 KB
Loading

0 commit comments

Comments
 (0)