Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace SpojSUMA
- {
- class Program
- {
- static void Main(string[] args)
- {
- int prev = 0;
- int act = 0;
- Console.WriteLine("Podaj pierwszą liczbę");
- for (; ;)
- {
- try
- {
- act = Int32.Parse(Console.ReadLine());
- Console.WriteLine("Wynik: " + (act + prev).ToString() + '\n');
- }
- catch(Exception ex)
- {
- Console.WriteLine("Nie podano poprawnej liczby!" + '\n');
- }
- prev += act;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement