Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- namespace RemoveNegativesAndReverse
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<int> numbers = Console.ReadLine()
- .Split(" ")
- .Select(int.Parse)
- .ToList();
- numbers.Reverse();
- numbers.RemoveAll(n => n < 0);
- Console.WriteLine(numbers.Count == 0 ? "empty" : string.Join(" ", numbers));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement