I keep getting a Runtime Error (NZEC) after submiting the solution to this problem spoj.pl/INTECSIM/problems/SARITHM/
this is my code:
using System;
using System.Text;
namespace SPOJ_SARITHM
{
class Program
{
static void Main(string[] args)
{
string input="";
string[] operandos;
Int64 respuesta;
while ((input = Console.ReadLine()) != null)
{
input=input.Replace(" ", "");
if (input.IndexOf('+') > -1)
{
operandos = input.Split('+');
respuesta = Int64.Parse(operandos[0]) + Int64.Parse(operandos[1]);
}
else if (input.IndexOf('-') > -1)
{
operandos = input.Split('-');
respuesta = Int64.Parse(operandos[0]) - Int64.Parse(operandos[1]);
}
else
{
operandos = input.Split('*');
respuesta = Int64.Parse(operandos[0]) * Int64.Parse(operandos[1]);
}
Console.WriteLine(input + "=" + respuesta.ToString());
}
}
}
}
If anyone could help me please, what's wrong with my code? and thank you on front