using System;
public class Test {
public static int ContarZeros(int n) {
int count = 0;
while (n % 10 == 0) {
count++;
n /= 10;
}
return count;
}
public static void Main() {
Console.WriteLine(ContarZeros(123000)); // esperado: 3
Console.WriteLine(ContarZeros(102030)); // esperado: 1
}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIFRlc3QgewoJcHVibGljIHN0YXRpYyBpbnQgQ29udGFyWmVyb3MoaW50IG4pIHsKCSAgICBpbnQgY291bnQgPSAwOwoJICAgIHdoaWxlIChuICUgMTAgPT0gMCkgewoJICAgICAgICBjb3VudCsrOwoJICAgICAgICBuIC89IDEwOwoJICAgIH0KCSAgICByZXR1cm4gY291bnQ7Cgl9CgkKCXB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkgewoJCUNvbnNvbGUuV3JpdGVMaW5lKENvbnRhclplcm9zKDEyMzAwMCkpOyAvLyBlc3BlcmFkbzogMwoJCUNvbnNvbGUuV3JpdGVMaW5lKENvbnRhclplcm9zKDEwMjAzMCkpOyAvLyBlc3BlcmFkbzogMQoJfQp9