Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Planet-D
//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 Plts { public string name; public int xCord; public int numberBlts; public string color; } public class Program { public static void Main(string[] args) { Program classProg = new Program (); List<Plts> listPlts = new List<Plts>(); listPlts.Add(new Plts {name = "HRed", xCord = 4, numberBlts = 10, color = "red"}); listPlts.Add(new Plts {name = "HBlue", xCord = 12, numberBlts = 10, color = "blue"}); listPlts.Add(new Plts {name = "net1", xCord = 11, numberBlts = 20, color = "gray"}); listPlts.Add(new Plts {name = "net2", xCord = 5, numberBlts = 20, color = "gray"}); listPlts.Add(new Plts {name = "net3", xCord = 8, numberBlts = 30, color = "gray"}); foreach (Plts llistPlst in listPlts) Console.Write(" | Основа1: " + llistPlst.name); Console.WriteLine(""); classProg.BPlrs(listPlts); Console.WriteLine(""); foreach (Plts llistPlst in listPlts) Console.Write(" | Основа2: " + llistPlst.name); Console.WriteLine(""); } public void BPlrs(List<Plts> l) { string str = "blue"; var lBluePlts = from list in l where list.color ==str select list; if (lBluePlts.Count() == 0) Console.Write(" Ноль! "); foreach (Plts lDemo in lBluePlts) { Console.Write(" | " + lDemo.name + " и " + lDemo.numberBlts); } } } }
run
|
edit
|
history
|
help
0
Prueba
Fórum ➡ Border of a string S with at least 3 non-overlapping solutions ( yield version ) ♦
Sort String
cs001
operatoru
Find the missing number in an array1
custom stack Implementation
3
MultiThreading and CancellationToken
Learning Rounding and Truncation from the Maths library