diff --git a/C03 ControlFlow/C03 ControlFlow.iml b/C03 ControlFlow/C03 ControlFlow.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/C03 ControlFlow/C03 ControlFlow.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/C03 ControlFlow/src/NumberCounter.java b/C03 ControlFlow/src/NumberCounter.java new file mode 100644 index 0000000..a800a90 --- /dev/null +++ b/C03 ControlFlow/src/NumberCounter.java @@ -0,0 +1,17 @@ +import java.util.Scanner; + +public class NumberCounter { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + long num = sc.nextLong(); + int[] hash = new int[10]; + while(num>0){ + hash[(int)(num%10)]++; + num/=10; + } + + for(int i : hash) + System.out.print(i+" "); + System.out.println(); + } +}