fork download
  1. using System;
  2. using system.linq;
  3. public class Test
  4. {
  5. public static void IfThen<T>(this IEnumerable<T> items, Func<T, bool> condition, Action<T> action)
  6. {
  7. foreach (T item in items)
  8. {
  9. if (condition(item))
  10. {
  11. action(item);
  12. }
  13. }
  14. }
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(2,7): error CS0246: The type or namespace name `system' could not be found. Are you missing an assembly reference?
prog.cs(5,36): error CS0246: The type or namespace name `IEnumerable' could not be found. Are you missing `System.Collections.Generic' using directive?
Compilation failed: 2 error(s), 0 warnings
stdout
Standard output is empty