Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class DigitCount {
- public static void main(String[] args) {
- Scanner keyboard = new Scanner(System.in);
- System.out.println("Please enter an integer ::");
- int a = keyboard.nextInt();
- int count = 0;
- while (a > 0){
- a = a / 10;
- count++;
- int sum = (count++) / count;
- }
- System.out.println(sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement