תנסה ככה:
קוד:
int x, y;
int check = 0;
x = int.Parse(Console.ReadLine());
y = int.Parse(Console.ReadLine());
switch (x)
{
case 0:
check=1;
break;
case 15:
check=1;
break;
case 30:
check=1;
break;
case 40:
check=1;
break;
case 60:
check=1;
break;
default:
check=0;
}
switch (y)
{
case 0:
check=1;
break;
case 15:
check=1;
break;
case 30:
check=1;
break;
case 40:
check=1;
break;
case 60:
check=1;
break;
default:
check=0;
}
if(check!=0)
Console.WriteLine(Math.Abs(x-y));
else
Console.WriteLine("error");