Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _05._Remove_Negatives_and_Reverse
- {
- class Program
- {
- static void Main(string[] args)
- {
- // Задача да печата числа до команда "stop"
- while (true) // Задавам безкраен цикъл
- {
- string command = Console.ReadLine();
- if (command == "stop")
- {
- Console.WriteLine("End!");
- // ако командата е "stop" спираме програмата
- break;
- }
- // ако не е "stop", тя ще е число затова няма да гръмне, когато парсваме стринг към инт
- int number = int.Parse(command);
- Console.WriteLine(number);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment