Skip to content

Instantly share code, notes, and snippets.

@Retterath
Created October 27, 2018 10:31
Show Gist options
  • Save Retterath/f342074d7172e51f8c2b689fe8e4099d to your computer and use it in GitHub Desktop.
Save Retterath/f342074d7172e51f8c2b689fe8e4099d to your computer and use it in GitHub Desktop.
Train (not completed)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Train
{
class Program
{
static void Main()
{
List<int> Wagons = Console.ReadLine()
.Split(' ')
.Select(int.Parse)
.ToList();
int capacityOfEach = int.Parse(Console.ReadLine());
while (true)
{
string line = Console.ReadLine();
string[] splittedLine = line.Split();
string command = splittedLine[0];
if (line == "end")
{
break;
}
if (command == "Add")
{
int numberToAdd = int.Parse(splittedLine[1]);
Wagons.Add(numberToAdd);
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment