P
P
ProblemBook.NET
Search…
⌃K
P
P
ProblemBook.NET
Search…
⌃K
ProblemBook.NET
LANGS
Задачник.NET
Math
Oop
ValueTypes
Strings
Linq
«QueryAfterRemove» (Решение)
«ClosureAndVariable» (Решение)
«QueryAfterRemove» (Задача)
«ClosureAndVariable» (Задача)
«EnumerableToArray» (Решение)
«QueryWithInc» (Решение)
«EnumerableToArray» (Задача)
«QueryWithInc» (Задача)
«LifeAfterYield» (Решение)
“YieldExceptionYield” (Решение)
«LifeAfterYield» (Задача)
«ExceptionYieldYield» (Решение)
«ClosureAndForeach» (Решение)
«TryYieldFinally» (Задача)
«ClosureAndFor» (Решение)
«ExceptionYieldYield» (Задача)
«YieldExceptionYield» (Решение)
«ClosureAndForeach» (Задача)
«ClosureAndFor» (Задача)
«YieldExceptionYield» (Задача)
Multithreading
Summary
Введение
ProblemBook.NET
Attribution-NonCommercial-NoDerivatives 4.0 International
Powered By GitBook

«QueryWithInc» (Задача)

Что выведет следующий код?
int Inc(int x)
{
Console.WriteLine("Inc: " + x);
return x + 1;
}
void Main()
{
var numbers = Enumerable.Range(0, 10);
var query =
(from number in numbers
let number2 = Inc(number)
where number2 % 2 == 0
select number2).Take(2);
foreach (var number in query)
Console.WriteLine("Number: " + number);
}
​Решение​
Previous
«EnumerableToArray» (Задача)
Next
«LifeAfterYield» (Решение)
Last modified 3yr ago
Copy link