public static void Main(string[] args) { CultureInfo.CurrentCulture = new CultureInfo("ru-RU"); try { Dollar dollar = new Dollar(decimal.Parse(Console.ReadLine())); Euro euro = new Euro(decimal.Parse(Console.ReadLine())); Console.WriteLine((Euro)dollar); Console.WriteLine((Dollar)euro); } catch (ArgumentException) { Console.WriteLine("error"); } }
public static void Main(string[] args) { try { CultureInfo.CurrentCulture = new CultureInfo("ru-RU"); var dol = new Dollar { Sum = decimal.Parse(Console.ReadLine()) }; var eu = new Euro { Sum = decimal.Parse(Console.ReadLine()) }; Console.WriteLine((Euro)dol); Console.WriteLine((Dollar)eu); } catch (ArgumentException) { Console.WriteLine("error"); } }
public static void Main(string[] args) { try { Dollar dollar = new Dollar { Sum = decimal.Parse(Console.ReadLine()) }; Euro euro = new Euro { Sum = decimal.Parse(Console.ReadLine()) }; Console.WriteLine((Euro)dollar); Console.WriteLine((Dollar)euro); } catch (ArgumentException) { Console.WriteLine("error"); } }
public static void Main(string[] args) { try { Dollar dollar = new Dollar { Sum = int.Parse(Console.ReadLine()) }; Euro euro = new Euro { Sum = int.Parse(Console.ReadLine()) }; Euro euro2 = (Euro)dollar; Dollar dollar2 = euro; Console.WriteLine(euro2); Console.WriteLine(dollar2); } catch (ArgumentException) { Console.WriteLine("error"); } }
public static void Main(string[] args) { var cultureInfo = new CultureInfo("ru-RU"); Thread.CurrentThread.CurrentCulture = cultureInfo; Thread.CurrentThread.CurrentUICulture = cultureInfo; try { var dollar = new Dollar { Sum = decimal.Parse(Console.ReadLine()) }; var euro = new Euro { Sum = decimal.Parse(Console.ReadLine()) }; Console.WriteLine((Euro)dollar); Console.WriteLine((Dollar)euro); } catch (ArgumentException) { Console.WriteLine("error"); } }
public static void Main(string[] args) { try { CultureInfo.CurrentCulture = new CultureInfo("ru-RU"); Dollar dollar = new Dollar() { Sum = int.Parse(Console.ReadLine()) }; Euro euro = new Euro() { Sum = int.Parse(Console.ReadLine()) }; Console.WriteLine((Euro)dollar); Dollar newDollar = euro; Console.WriteLine(newDollar); } catch (ArgumentException) { Console.WriteLine("error"); } }