Witam, z ciekawości postanowiłem spróbować pobawić się tym całym C#'pem, napisałem taki oto kod, kompiluje się, ale po wpisaniu prawidłowego wyniku pokazuje, że jest błąd.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
System.Console.WriteLine("===Capcha===");
System.Console.WriteLine();
Random rnd = new Random();
int liczba1 = rnd.Next(1, 10);
int liczba2 = rnd.Next(1, 10);
System.Console.Write("Podaj wynik dodawania " + liczba1 + "+" + liczba2 + " : ");
int read = Console.Read();
if (read == liczba1 + liczba2)
{
System.Console.WriteLine("Dobrze!");
Thread.Sleep(3000);
}
else
{
System.Console.Write("Zle! Sproboj ponownie!");
Thread.Sleep(3000);
}
}
}
}