Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. namespace ConsoleApp24
  2. {
  3. class Program
  4. {
  5. static void Main(string[] args)
  6. {
  7. int b;
  8. double x, wynik;
  9. Console.Clear();
  10.  
  11. Console.WriteLine("Podaj a");
  12. x = double.Parse(Console.ReadLine());
  13.  
  14. Console.WriteLine("Podaj b");
  15. b = int.Parse(Console.ReadLine());
  16.  
  17. wynik = x + b;
  18.  
  19. Console.WriteLine("a = {0:###}", x);
  20. Console.WriteLine("b = {0:###}", b);
  21. Console.WriteLine("Suma = {0:###}", wynik);
  22.  
  23. Console.WriteLine("Naciśnij dowolny klawisz aby kontynuować");
  24. Console.WriteLine("Naciśnij ESC aby zakończyć");
  25.  
  26. do
  27. {
  28.  
  29. Console.WriteLine("Podaj dowolną cyfrę");
  30. x = double.Parse(Console.ReadLine());
  31. Console.WriteLine("Poprzednia suma = {0:###}", wynik);
  32. Console.WriteLine("Wybrana cyfra = {0:###}", x);
  33. wynik = wynik + x;
  34. Console.WriteLine("Suma = {0:###}", wynik);
  35. Console.WriteLine("Naciśnij dowolny klawisz aby kontynuować");
  36. Console.WriteLine("Naciśnij ESC aby zakończyć");
  37.  
  38. }
  39. while (Console.ReadKey().Key != ConsoleKey.Escape);
  40.  
  41.  
  42. }
  43.  
  44.  
  45.  
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement