I have a problem on one website. On the website you get tasks to program. Then you upload it on and it runs the program.
I don't know what is wrong but I get this error:
Unhandled Exception: System.FormatException: Input string was not in the correct format
at System.Int32.Parse (System.String s) [0x00000] in <filename unknown>:0
at System.Convert.ToInt32 (System.String value) [0x00000] in <filename unknown>:0
at ImePrim.Program.Main () [0x00000] in <filename unknown>:0
My code:
namespace ImePrim
{
class Program
{
static void Main()
{
int num1;
int num2;
float answer;
num1 = Convert.ToInt32(Console.ReadLine());
num2 = Convert.ToInt32(Console.ReadLine());
answer = num1 + num2;
Console.Write(answer);
}
}
}
If anyone knows how to fix thanks.