|
|
back to boardplease help...... Posted by aleko 1 Sep 2010 15:14 int a, b, c; a=Console.Read(); b = Console.Read(); c = a + b; Console.Write(c); what is there wrong? Re: please help...... int[] nums=Console.ReadLine().Split(new char[]{'\n','\t',' '}, StringSplitOptions.RemoveEmptyEntries).Select(s=> int.Parse(s)).ToArray(); Console.WriteLine(nums[0]+nums[1]); go and learn C# Edited by author 01.09.2010 19:13 Re: please help...... Posted by aleko 2 Sep 2010 16:40 Is not any easier way? Edited by author 02.09.2010 17:33 Edited by author 02.09.2010 17:33 Re: please help...... Паскаль рулит :) Re: please help...... int a, b, c; a=Console.Read(); b = Console.Read(); c = a + b; Console.Write(c); what is there wrong? Re: please help...... Posted by xerxe 29 Dec 2010 04:19 There is a short way of writing that: String[] s; s = Console.ReadLine().Split(); Console.WriteLine(int.Parse(s[0])+int.Parse(s[1])); |
|
|