Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- public class Program
- {
- public static void Main()
- {
- Person your = new Person();
- Person yourFriend = new Person();
- PersonGroup pidors = your + yourFriend;
- Console.WriteLine("Решение от Жака Фреско");
- }
- }
- class Person
- {
- public static PersonGroup operator +(Person firstPerson, Person secondPerson)
- {
- var personGroup = new PersonGroup();
- personGroup.Persons.Add(firstPerson);
- personGroup.Persons.Add(secondPerson);
- return personGroup;
- }
- }
- class PersonGroup
- {
- public List<Person> Persons {get;set;}
- }
Advertisement
Add Comment
Please, Sign In to add comment