using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace LinRov { class Program { static void Main(string[] args) { string volba; Console.WriteLine(""); Console.Write(" Chcete vypsat rozsahy datových typů čísel? A/N : "); volba = Console.ReadLine().ToUpper(); if (volba == "A") { Ciselne_typy_rozsahy(); } LinearniRovnice(); Console.WriteLine(""); Console.WriteLine(" KONEC PROGRAMU!"); Console.WriteLine(""); Console.Write(" Stiskněte klávesu ENTER"); Console.ReadLine(); } private static void Ciselne_typy_rozsahy() { Console.WriteLine(""); Console.WriteLine(" DATOVÉ TYPY PRO CELÁ ČÍSLA:"); Console.WriteLine(""); Console.WriteLine(" byte: " + byte.MinValue + " až " + byte.MaxValue); Console.WriteLine(""); Console.WriteLine(" short: " + short.MinValue + " až " + short.MaxValue); Console.WriteLine(""); Console.WriteLine(" ushort: " + ushort.MinValue + " až " + ushort.MaxValue); Console.WriteLine(""); Console.WriteLine(" int: " + int.MinValue + " až " + int.MaxValue); Console.WriteLine(""); Console.WriteLine(" uint: " + uint.MinValue + " až " + uint.MaxValue); Console.WriteLine(""); Console.WriteLine(" long: " + long.MinValue + " až " + long.MaxValue); Console.WriteLine(""); Console.WriteLine(" ulong: " + ulong.MinValue + " až " + ulong.MaxValue); Console.WriteLine(""); Console.WriteLine(""); Console.WriteLine(" DATOVÉ TYPY PRO REÁLNÁ ČÍSLA:"); Console.WriteLine(""); Console.WriteLine(" decimal: " + decimal.MinValue + " až " + decimal.MaxValue); Console.WriteLine(""); Console.WriteLine(" float: " + float.MinValue + " až " + float.MaxValue); Console.WriteLine(""); Console.WriteLine(" double: " + double.MinValue + " až " + double.MaxValue); Console.WriteLine(""); Console.WriteLine(""); Console.Write(" Stiskněte klávesu ENTER"); Console.ReadLine(); } private static void LinearniRovnice() { double koefA, koefB, reseni; string koefA_str, koefB_str, reseni_str; string volba1; bool test; Console.WriteLine(""); Console.WriteLine(""); Console.WriteLine(" ŘEŠENÍ LINEÁRNÍ ROVNICE V OBECNÉM TVARU AX + B = 0"); do { test = false; Console.WriteLine(""); Console.Write(" Zadejte koeficient A = "); koefA_str = Console.ReadLine(); Console.WriteLine(""); Console.Write(" Zadejte koeficient B = "); koefB_str = Console.ReadLine(); koefA = Convert.ToDouble(koefA_str); koefB = Convert.ToDouble(koefB_str); if (koefA == 0) { Console.WriteLine(""); Console.WriteLine(" Zadání není lineární rovnice!"); Console.WriteLine(""); Console.Write(" Chcete pokračovat? A/N : "); volba1 = Console.ReadLine().ToUpper(); if (volba1 == "A") { test = true; } } else { reseni = (-koefB) / koefA; reseni_str = Convert.ToString(reseni); Console.WriteLine(""); Console.WriteLine(" Řešení lineární rovnice = " + reseni_str); Console.WriteLine(""); Console.Write(" Chcete pokračovat? A/N : "); volba1 = Console.ReadLine().ToUpper(); if (volba1 == "A") { test = true; } } } while (test); } } }