fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static int IloscCyfr(int x)
  6. {
  7. return x != 0 ? (int) Math.Log10(Math.Abs(x))+1 : 0;
  8. }
  9. public static void Main()
  10. {
  11. int Liczba, t;
  12. t = Convert.ToInt32(Console.ReadLine());
  13. while(t-- != 0)
  14. {
  15. Liczba = Convert.ToInt32(Console.ReadLine());
  16. Console.WriteLine(IloscCyfr(Liczba));
  17. }
  18. }
  19. }
Success #stdin #stdout 0.04s 33952KB
stdin
6
-111
0
111
123456789
1234
-12345
stdout
3
0
3
9
4
5