Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Main {
- public static int countOfDigits(int n) {
- if (n == 0) return 0;
- return 1 + countOfDigits(n / 10);
- }
- public static void main(String[] args) {
- System.out.println(countOfDigits(5321));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment