Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- string jeden, dwa;
- float a, b;
- bool y = true;
- if đ
- Console.Write("Podaj liczbÄ a: ");
- jeden = Console.ReadLine();
- Console.Write("Podaj liczbÄ b: ");
- dwa = Console.ReadLine();
- if (float.TryParse(jeden, out a) & float.TryParse(dwa, out b))
- {
- Console.Write("Podaj symbol( +,-,*,/) dziaĆania : ");
- string dziaĆanie = Console.ReadLine();
- switch (dziaĆanie)
- {
- case "+":
- Console.WriteLine("Wynik tego dodawania to: " + (a + b));
- break;
- case "-":
- Console.WriteLine("Wynik tego odejmowania to: " + (a - b));
- break;
- case "*":
- Console.WriteLine("Wynik tego mnoĆŒenia to: " + (a * b));
- break;
- case "/":
- Console.WriteLine("Wynik tego dzielenia to: " + (a / b));
- break;
- Deafult:
- Console.WriteLine("Niepoprawne dziaĆanie");
- Console.ReadLine();
- }
- }
- else
- Console.WriteLine("Niepoprawne dane");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement