MCPcopy Create free account
hub / github.com/Hazrat-Ali9/Computer-Programming / main

Method main

Problem10.java:7–33  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

5public class Problem10 {
6
7 public static void main(String[] args) {
8 // TODO Auto-generated method stub
9 Scanner scan = new Scanner(System.in);
10 int[] digitCount;
11 int N, number;
12
13 N = scan.nextInt();
14 scan.nextLine();
15 digitCount = new int[N];
16
17 for (int i = 0; i < N; i++) {
18 number = scan.nextInt();
19
20 while (number < 0 || number > 10000001) {
21 number = scan.nextInt();
22
23 }
24
25 digitCount[i] = Integer.toString(number).length();
26 }
27 scan.close();
28
29 for (int i = 0; i < digitCount.length; i++) {
30 System.out.printf("%d\n", digitCount[i]);
31 }
32
33 }
34
35}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected