ERROR: Cannot implicitly convert type 'int' to 'System.Collections.Generic.List<int>
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Please enter list of cities");
List<int> input1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Please enter second city name");
int input2 = Convert.ToInt32(Console.ReadLine());
int output = UserProgramCode.GetElements(input1, input2);
Console.WriteLine(output);
Console.ReadLine();
}
}
class UserProgramCode
{
public static List<int> GetElements(List<int> input1, int input2)
{
List<int> output = new List<int>();
foreach (int li in input1)
{
if (li < input2)
{
output.Add(li);
}
}
if (output.Count >= 1)
{
output.Sort();
output.Reverse();
return output;
}
else
{
output.Add(-1);
return output;
}
}
}
}