Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.IO;
- namespace Olimp
- {
- class Team
- {
- public Team(int power)
- {
- this.power = power;
- }
- public Team()
- {
- }
- private int power;
- public int Powah {
- get { return this.power; }
- set { this.power = value; }
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- StreamReader reader = new StreamReader("info.txt");
- List<Team> teams = new List<Team>();
- while(!reader.EndOfStream)
- teams.Add(new Team {
- Powah=int.Parse(reader.ReadLine())
- } );
- for (int j = 0; j < length; j++)
- for (int i = 0; i < teams.Count-1; i+=2)
- {
- if (teams[i].Powah < teams[i + 1].Powah)
- {
- Team temp = teams[i];
- teams[i] = teams[i + 1];
- teams[i + 1] = temp;
- }
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement