Advertisement
Guest User

Untitled

a guest
Jul 29th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. class Program
  2.     {
  3.         static void Main(string[] args)
  4.         {
  5.             int capacity = int.Parse(Console.ReadLine());
  6.             List<int> w = new List<int>();
  7.             List<int> m = new List<int>();
  8.  
  9.             while(true)
  10.             {
  11.                 string soldierData = Console.ReadLine();
  12.                 int res = 0;
  13.                 if(int.TryParse(soldierData, out res) && res == 0)
  14.                 {
  15.                     break;
  16.                 }
  17.  
  18.                 string[] data = soldierData.Split(' ');
  19.                 w.Add(int.Parse(data[0]));
  20.                 m.Add(int.Parse(data[1]));
  21.             }
  22.         }
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement