-
-
Save anonymous/0bd3a441d4b62c82692428d0f7b5b098 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
class Student { | |
public string Name { get; set; } | |
public int Id { get; set; } | |
} | |
struct ExamResult { | |
public Student Who { get; set; } | |
public DateTime When { get; set; } | |
public int Mark { get; set; } | |
} | |
namespace OpIsAFaggot { | |
class Program { | |
static void Main(string[] args) { | |
var names = new[] {"Славик", "Ванька", "Митяй", "Глеб", "Данил"}; | |
var surnames = new[] {"Сычёв", "Шеремет", "Бафомет", "Срака"}; | |
var random = new Random(); | |
var students = Enumerable.Repeat(1, 10) | |
.Select(x => new Student { | |
Name = names[random.Next(names.Length)] | |
+ surnames[random.Next(surnames.Length)], | |
Id = random.Next(1000, 9999) | |
}); | |
Func<ExamResult[]> readExam = | |
() => students.Select(x => new ExamResult { | |
Who = x, | |
Mark = int.Parse(Console.ReadLine()), | |
When = DateTime.Parse(Console.ReadLine()) | |
}).ToArray(); | |
var матиша = readExam(); | |
var русиш = readExam(); | |
var losers = students.Where( | |
x => матиша.First(y => y.Who == x).Mark < 3 | |
&& русиш.First(y => y.Who == x).Mark < 3 | |
); | |
foreach (var loser in losers) { | |
Console.WriteLine("{0} is a loser!", loser); | |
} | |
} // void Main | |
} // class | |
} // ns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment