fork download
  1. //Rextester.Program.Main is the entry point for your code. Don't change it.
  2. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5
  3.  
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text.RegularExpressions;
  8.  
  9. namespace Rextester
  10. {
  11. public class Program
  12. {
  13. public static void Main(string[] args)
  14. {
  15. Console.WriteLine("Podaj 1 - jeśli DODAJ, Podaj 2 - jeśli ODEJMIJ, Podaj 3 - jeśli POMNÓŻ, Podaj 4 - jeśli podziel");
  16. int x = Int32.Parse(Console.ReadLine());
  17.  
  18. switch(x)
  19. {
  20.  
  21. case 1:
  22. Console.WriteLine("Podaj dwie liczby do dodania");
  23. int d = Int32.Parse(Console.ReadLine());
  24. int d2 = Int32.Parse(Console.ReadLine());
  25. int d3 = d + d2;
  26. Console.WriteLine("Wynik dodawania to {0}", d3);
  27. break ;
  28. }
  29.  
  30.  
  31. Console.ReadKey();
  32.  
  33.  
  34. }
  35. }
  36. }
Success #stdin #stdout 0.03s 15092KB
stdin
1
2
3
stdout
Podaj 1 - jeśli DODAJ, Podaj 2 - jeśli ODEJMIJ, Podaj 3 - jeśli POMNÓŻ, Podaj 4 - jeśli podziel
Podaj dwie liczby do dodania
Wynik dodawania to 5