public static void Main(string[] args)
        {
            CultureInfo.CurrentCulture = new CultureInfo("ru-RU");

            Fahrenheit fahrenheit = new Fahrenheit(double.Parse(Console.ReadLine()));
            Celcius    celcius    = new Celcius(double.Parse(Console.ReadLine()));

            Console.WriteLine((Celcius)fahrenheit);
            Console.WriteLine((Fahrenheit)celcius);
        }
コード例 #2
0
        public static void Main(string[] args)
        {
            Fahrenheit farenheit = new Fahrenheit {
                Gradus = double.Parse(Console.ReadLine())
            };
            Celcius celcius = new Celcius {
                Gradus = double.Parse(Console.ReadLine())
            };

            Console.WriteLine((Celcius)farenheit);
            Console.WriteLine((Fahrenheit)celcius);
        }
コード例 #3
0
        public static void Main(string[] args)
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("ru-RU");
            Fahrenheit fahrenheit = new Fahrenheit {
                Gradus = int.Parse(Console.ReadLine())
            };
            Celcius celcius = new Celcius {
                Gradus = int.Parse(Console.ReadLine())
            };

            Console.WriteLine((Celcius)fahrenheit);
            Console.WriteLine((Fahrenheit)celcius);
        }
        public static void Main(string[] args)
        {
            CultureInfo.CurrentCulture = new CultureInfo("ru-RU");
            var far = new Fahrenheit {
                Gradus = double.Parse(Console.ReadLine())
            };
            var cel = new Celcius {
                Gradus = double.Parse(Console.ReadLine())
            };

            Console.WriteLine((Celcius)far);
            Console.WriteLine((Fahrenheit)cel);
        }
        public static void Main(string[] args)
        {
            CultureInfo.CurrentCulture = new CultureInfo("ru-RU");
            Fahrenheit fahrenheitDegrees = new Fahrenheit {
                Gradus = double.Parse(Console.ReadLine())
            };
            Celcius celciusDegrees = new Celcius {
                Gradus = double.Parse(Console.ReadLine())
            };

            Console.WriteLine((Celcius)fahrenheitDegrees);
            Console.WriteLine((Fahrenheit)celciusDegrees);
            Console.ReadKey();
        }
コード例 #6
0
        public static void Main(string[] args)
        {
            int        fahr = int.Parse(Console.ReadLine());
            Fahrenheit f    = new Fahrenheit {
                Gradus = fahr
            };

            Console.WriteLine((Celcius)f);

            int     celc = int.Parse(Console.ReadLine());
            Celcius c    = new Celcius {
                Gradus = celc
            };

            Console.WriteLine((Fahrenheit)c);
        }
        public static void Main(string[] args)
        {
            var cultureInfo = new CultureInfo("ru-RU");

            Thread.CurrentThread.CurrentCulture   = cultureInfo;
            Thread.CurrentThread.CurrentUICulture = cultureInfo;
            var fahrenheit = new Fahrenheit {
                Gradus = double.Parse(Console.ReadLine())
            };
            var celcius = new Celcius {
                Gradus = double.Parse(Console.ReadLine())
            };

            Console.WriteLine((Celcius)fahrenheit);
            Console.WriteLine((Fahrenheit)celcius);
        }
コード例 #8
0
 public static void Main(string[] args)
 {
     try
     {
         CultureInfo.CurrentCulture = new CultureInfo("ru-RU");
         Fahrenheit tf = new Fahrenheit {
             Gradus = double.Parse(Console.ReadLine())
         };
         Celcius tc = new Celcius {
             Gradus = double.Parse(Console.ReadLine())
         };
         Console.WriteLine($"{((Celcius)tf).Gradus:f2}");
         Console.WriteLine($"{((Fahrenheit)tc).Gradus:f2}");
     }
     catch (Exception)
     {
         Console.WriteLine("error");
     }
 }
        public static void Main(string[] args)
        {
            try
            {
                Fahrenheit fahrenheit = new Fahrenheit()
                {
                    Gradus = int.Parse(Console.ReadLine())
                };
                Celcius celcius = new Celcius()
                {
                    Gradus = int.Parse(Console.ReadLine())
                };

                CultureInfo.CurrentCulture = new CultureInfo("ru-RU");
                Console.WriteLine((Celcius)fahrenheit);
                Console.WriteLine((Fahrenheit)celcius);
            }
            catch (Exception)
            {
                Console.WriteLine("error");
            }
        }