123456789101112131415161718 |
- using System;
- namespace CricketDuck_Standard_CLI
- {
- public class Parser
- {
- public static double parseDouble(string s)
- {
- if (!s.Contains ("."))
- return int.Parse (s);
- string part1 = s.Substring (0, s.IndexOf ('.'));
- string part2 = s.Substring (s.IndexOf ('.') + 1);
- double d = int.Parse (part1);
- d += int.Parse (part2) / Math.Pow (10, part2.Length);
- return d;
- }
- }
- }
|