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 _1._5._Remove_Negatives_and_Reverse
- {
- class Program
- {
- static void Main()
- {
- List<int> inputNum = Console.ReadLine().Split().Select(int.Parse).ToList();
- inputNum.RemoveAll(n => n < 0);
- if (inputNum.Count == 0)
- {
- Console.WriteLine("empty");
- }
- inputNum.Reverse();
- Console.WriteLine(string.Join(" ", inputNum));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment