+ 3
Could you please.help me, I don't know what is wrong? Thanks
3 ответов
+ 2
I made a few changes, troubled lines had been commented.
using System;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
int x = 1;
int y = 2;
//Console.WriteLine("What is esult of " + x + "*" + y " ?");
Console.Write("What is result of " + x + "*" + y + " ? ");
//int result = Convert.ToInt32(Console.Read());
int result = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(result);
//int anwser = x*y;
int answer = x*y;
switch (Math.Abs(answer - result))
{
case 0:
Console.WriteLine("Well done boii");
break;
case 1:
Console.WriteLine("You are very close");
break;
case 2:
Console.WriteLine("Not bad but still wrong");
break ;
case 3:
Console.WriteLine("You are totaly out");
break;
default:
Console.WriteLine ("You have no idea what math means");
break;
}
}
}
}
+ 3
Oh thank you so much, you gave me useful sight on the matter.
+ 1
You're welcome! glad if it helps : )