У меня есть Java-программа, которая подсчитывает цифры в целом числе с помощью цикла for
она возвращает мне счетчик как количество цифр минус 1
Например.
if i enter 6 digit integer it returns count of 5
if I enter 10 digit integer it returns count of 9
public class DigitCount {
public static void main(String[] args) {
int a=123456;
int count=0;
for (int i=0;i
Подробнее здесь: https://stackoverflow.com/questions/786 ... -becomes-0