|
|
back to boardC# crash I uploaded the following solution but it only says "crash": using System; namespace Week2 { class Program { static void Main(string[] args) { int a, b; a = int.Parse(Console.ReadLine()); b = int.Parse(Console.ReadLine()); Console.WriteLine(a + b); } } } Re: C# crash It happens because of you use ReadLine. These digits are on the same line, so you should just split them by space. You can find an example there: http://acm.timus.ru/help.aspx?topic=csharp using System; public class Sum { private static void Main() { string[] tokens = Console.ReadLine().Split(' '); Console.WriteLine(int.Parse(tokens[0]) + int.Parse(tokens[1])); } } Edited by author 14.10.2012 01:59 |
|
|