fork(1) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. private static void Print(double x) {
  6. int n = (int)Math.Log10(x);
  7. if (n > 2) {
  8. x /= Math.Pow(10, n-2);
  9. }
  10. Console.WriteLine((int)x);
  11. }
  12. public static void Main()
  13. {
  14. Print(1234567);
  15. Print(123456);
  16. Print(12345);
  17. Print(1234.5);
  18. Print(1000000);
  19. Print(100000);
  20. Print(10000);
  21. Print(1000);
  22. }
  23. }
Success #stdin #stdout 0.04s 23872KB
stdin
Standard input is empty
stdout
123
123
123
123
100
100
100
100