using System;
using System.Linq;
public class Test
{
public static void Main()
{
int[] msv = { -1, 2, 3, -4 };
var res = from n in msv
where n > 0
select n; // 2, 3
for(int i in res) {
Console.WriteLine(i);
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uTGlucTsKCnB1YmxpYyBjbGFzcyBUZXN0CnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKCXsKCQlpbnRbXSBtc3YgPSB7IC0xLCAyLCAzLCAtNCB9OwoJCXZhciByZXMgPSBmcm9tIG4gaW4gbXN2CiAgICAgICAgCSAgd2hlcmUgbiA+IDAKCSAgICAgICAgICBzZWxlY3QgbjsgLy8gMiwgMwoJCWZvcihpbnQgaSBpbiByZXMpIHsKCQkJQ29uc29sZS5Xcml0ZUxpbmUoaSk7CgkJfQoJfQp9
prog.cs(12,28): error CS1525: Unexpected symbol `in', expecting `)', `,', `;', `[', or `='
prog.cs(14,17): error CS1525: Unexpected symbol `}', expecting `)', `,', `;', `[', or `='
prog.cs(16,1): error CS8025: Parsing error
Compilation failed: 3 error(s), 0 warnings