fork(2) download
  1. using System;
  2.  
  3. namespace YesImAnAdult
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. Func<string,string>f= s=>s.Contains(".")?float.Parse(s)<1.4?"1.4":s:int.Parse(s)<18?"18":s;
  10.  
  11. Console.WriteLine(f("0")); //18
  12. Console.WriteLine(f("1")); //18
  13. Console.WriteLine(f("2")); //18
  14. Console.WriteLine(f("12")); //18
  15. Console.WriteLine(f("18")); //18
  16. Console.WriteLine(f("43")); //43
  17. Console.WriteLine(f("122")); //122
  18.  
  19. Console.WriteLine(f("0.0")); //1.4
  20. Console.WriteLine(f("1.04")); //1.4
  21. Console.WriteLine(f("1.225")); //1.4
  22. Console.WriteLine(f("1.399")); //1.4
  23. Console.WriteLine(f("1.4")); //1.4
  24. Console.WriteLine(f("1.74")); //1.74
  25. Console.WriteLine(f("2.0")); //2.0
  26. Console.WriteLine(f("2.72")); //2.72
  27. }
  28. }
  29. }
Success #stdin #stdout 0s 29664KB
stdin
Standard input is empty
stdout
18
18
18
18
18
43
122
1.4
1.4
1.4
1.4
1.4
1.74
2.0
2.72