Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication5
- {
- class Program
- {
- static void Main(string[] args)
- {
- int ch;
- var l = 0;
- string s = Console.ReadLine();
- string[] w = s.Split(' ');
- try
- {
- foreach (var el in w)
- {
- ch = int.Parse(el);
- if (ch > 20 && ch < 40)
- {
- l = ch;
- Console.Write(l);
- Console.Write(" ");
- }
- }
- }
- catch (System.FormatException e)
- {
- Console.WriteLine(e.Message);
- }
- Console.WriteLine(" ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement