Skip to content

Commit

Permalink
日常练习
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunbeam-5 committed Jun 4, 2022
1 parent 4c03266 commit 7a5231a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
15 changes: 15 additions & 0 deletions 20220602/src/数字9出现的次数.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
public class 数字9出现的次数 {
public static void main(String[] args) {
int i = 0;
for (int a = 1; a <= 100 ;a++) {
if ((a / 10) == 9) {
i++;
}
if ((a % 10) == 9) {
i++;
}
}
System.out.println(i);
}
}

0 comments on commit 7a5231a

Please sign in to comment.