using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _10.RemoveNegativesAndReverse { public class RemoveNegativesAndReverse { public static void Main(string[] args) { string inputStr = Console.ReadLine(); string[] inputArr = inputStr.Split(' '); List inputInt = new List(); List newIntList = new List(); for (int i = 0; i < inputArr.Length; i++) { inputInt.Add(int.Parse(inputArr[i])); } for (int i = 0; i < inputInt.Count; i++) { if (inputInt[i] > 0) { newIntList.Add(inputInt[i]); } } if (newIntList.Any()) { newIntList.Reverse(); foreach (var item in newIntList) { Console.WriteLine(item); } } else { Console.WriteLine("empty"); } } } }