My problem is with this simple code.. When my input is lets say "6 6 2", and i try to convert to Int32, the result is something else than i expected.. Here it is: 6 6 2 54
Here is the code of my simple program in C#:
using System;
public class Program
{
public static void Main()
{
string i = Console.ReadLine();
int a = Convert.ToInt32(i[0]);
int b = Convert.ToInt32(i[2]);
int c = Convert.ToInt32(i[4]);
Console.WriteLine(a);
}
}
Please help, I am stuck with this