Skip to content

Commit

Permalink
日常练习
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunbeam-5 committed May 31, 2022
1 parent df29fa6 commit a1a63e4
Show file tree
Hide file tree
Showing 13 changed files with 105 additions and 0 deletions.
3 changes: 3 additions & 0 deletions 20220531/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions 20220531/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions 20220531/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions 20220531/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions 20220531/20220531.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
Binary file not shown.
Binary file added 20220531/out/production/20220531/打印X图形.class
Binary file not shown.
Binary file added 20220531/out/production/20220531/模拟登陆.class
Binary file not shown.
Binary file added 20220531/out/production/20220531/水仙花数.class
Binary file not shown.
14 changes: 14 additions & 0 deletions 20220531/src/九九乘法表.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import java.util.Scanner;

public class 九九乘法表 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= 9 - n + i; j++) {
System.out.print(j+"*"+i+"="+i*j+" ");
}
System.out.println();
}
}
}
25 changes: 25 additions & 0 deletions 20220531/src/打印X图形.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import java.util.Scanner;

public class 打印X图形 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = n;
for (int i = 0; i < n / 2 + 1; i++) {


for (int j = 1; j <= m; j++) {
if (j == 1) {
System.out.print("*");
} else if (j == m) {
System.out.print("*");
}else {
System.out.print(" ");
}
}
m -= 2;
System.out.println();

}
}
}
20 changes: 20 additions & 0 deletions 20220531/src/模拟登陆.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import java.util.Scanner;

public class 模拟登陆 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
for (int i = 0; i < 3; i++) {
String str1 = sc.nextLine();
String str2 = "Isbella";
if (str1.equals(str2)){
System.out.println("登录成功");
break;
}
else{
System.out.println("密码错误");
}
}


}
}
12 changes: 12 additions & 0 deletions 20220531/src/水仙花数.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
public class 水仙花数 {
public static void main(String[] args) {
for (int i = 100; i < 999; i++) {
int a = i / 100;
int b = i / 10 % 10;
int c = i % 100 % 10;
if (i == Math.pow(a,3) + Math.pow(b,3) + Math.pow(c,3)){
System.out.println(i);
}
}
}
}

0 comments on commit a1a63e4

Please sign in to comment.