Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
fun with yield return
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { IList<int> list = new List<int>(){1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; foreach(var i in Y(list)){ Console.WriteLine(i.ToString()+". Hello, world!"); } } public static IEnumerable<int> Y(ICollection<int> list){ foreach(var i in list){ if(i%2==0) yield return i; else yield return -1; } } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Retirar valores das tags de um XML padrão TISS/ANS SIB
FixConsectiveDuplicates
SevenSevenSeven
Ternary Operator
eden
Display the pattern like diamond by using c# for loop
Selection Sort
asxsdsdxasd
SSTR PARS
Big numbers
Please log in to post a comment.