📅  最后修改于: 2022-03-11 14:48:38.143000             🧑  作者: Mango
string foo = Console.ReadLine();
string[] tokens = foo.Split(",");
List nums = new List();
int oneNum;
foreach(string s in tokens)
{
if(Int32.TryParse(s, out oneNum))
nums.Add(oneNum);
}