- 2
[SOLVED] Problem w/ RobotBarman
(5th case of C# course, 8th unit project)
2 odpowiedzi
+ 3
try
{
int drinks = Convert.ToInt32(Console.ReadLine());
int shelves = Convert.ToInt32(Console.ReadLine());
//your code goes here
Console.WriteLine(drinks/shelves);
}
/*
* 1. DivideByZeroException => "At least 1 shelf"
* 2. FormatException => "Please insert an integer"
*/
catch (DivideByZeroException ex)
{
Console.WriteLine("At least 1 shelf");
}
catch (FormatException ex)
{
Console.WriteLine("Please insert an integer");
}
0
It's not working bro