you have to take input one time from user using space. And after that split those values⌠like below:
a = input()
b = a.split(" ")
c =int(b[0])
d = int(b[1])
Whatâs the problem on my code ? When I test my code I get runtime error.
My code is:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Add_Them_Up
{
class Program
{
static void Main(string[] args)
{
int a, b;
a = Convert.ToInt32(Console.ReadLine());
b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(a + b + "\n");
Console.ReadKey();
}
}
}
actually you are doing mistake to get input, toph return array of two numbers you have to parse them into local variable separately . Need more idea about that ?
To solve your problem, Iâd suggest you to read the whole statement again, carefully.
Every problem has test cases beyond the sample ones shown in the problem statement. Your program must be able to handle those hidden cases. Pay close attention to the input specification.