Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ConsoleApp24
- {
- class Program
- {
- static void Main(string[] args)
- {
- int b;
- double x, wynik;
- Console.Clear();
- Console.WriteLine("Podaj a");
- x = double.Parse(Console.ReadLine());
- Console.WriteLine("Podaj b");
- b = int.Parse(Console.ReadLine());
- wynik = x + b;
- Console.WriteLine("a = {0:###}", x);
- Console.WriteLine("b = {0:###}", b);
- Console.WriteLine("Suma = {0:###}", wynik);
- Console.WriteLine("Naciśnij dowolny klawisz aby kontynuować");
- Console.WriteLine("Naciśnij ESC aby zakończyć");
- do
- {
- Console.WriteLine("Podaj dowolną cyfrę");
- x = double.Parse(Console.ReadLine());
- Console.WriteLine("Poprzednia suma = {0:###}", wynik);
- Console.WriteLine("Wybrana cyfra = {0:###}", x);
- wynik = wynik + x;
- Console.WriteLine("Suma = {0:###}", wynik);
- Console.WriteLine("Naciśnij dowolny klawisz aby kontynuować");
- Console.WriteLine("Naciśnij ESC aby zakończyć");
- }
- while (Console.ReadKey().Key != ConsoleKey.Escape);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement