Cassimus

Błędy

Oct 17th, 2025
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1.  
  2. internal class Program
  3. {
  4. private static void Main(string[] args)
  5. {
  6. Console.WriteLine("Prosty kalkulator")
  7. Cnsole.WriteLine("Podaj numer działania: ");
  8. Console.WriteLine("1. Dodawanie");
  9. Cnsole.WriteLine("2. Odejmowanie");
  10. Console.WriteLine("3. Mnożenie");
  11. Console.WriteLine(4.Dzielenie);
  12.  
  13. int wybor = Console.ReadLine();
  14.  
  15. Console.WriteLine("podaj pierwszą liczbę");
  16. float liczbaA = int.Parse(Console.ReadLine());
  17. Console.WriteLine("Podaj drugą liczbę");
  18. int liczbaB = float.Parse(Console.ReadLine());
  19.  
  20. switch (wybor)
  21. {
  22. case 1:
  23. Console.WriteLine($"Wynik: {liczbaA + liczbaB}");
  24. break;
  25. case 2:
  26. Console.WriteLine($"Wynik: {liczbaA - liczbaB}");
  27. break;
  28. case 3:
  29. Console.WriteLine($"Wynik: {liczbaA * liczbaB}");
  30. break;
  31. case4:
  32. Console.WriteLine($"Wynik: {liczbaA / liczbaB}");
  33. break;
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment