Skip to content

Commit 997306e

Browse files
committed
🎉 feat: initial commit for 1021 using java
1 parent c84951c commit 997306e

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import java.io.BufferedReader;
2+
import java.io.IOException;
3+
import java.io.InputStreamReader;
4+
5+
public class Main {
6+
public static void main(String[] args) throws IOException {
7+
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
8+
char[] chars = br.readLine().toCharArray();
9+
int[] count = new int[11];
10+
for (int i = 0; i < chars.length; i++) {
11+
count[chars[i] - '0']++;
12+
}
13+
for (int i = 0; i < 11; i++) {
14+
if (count[i] != 0) {
15+
System.out.println(i + ":" + count[i]);
16+
}
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)