0
Test case 3 skee-ball fails, I need some help
class Program { static void Main(string[] args) { double points, tickets; const double costGun = 40; const double costTicket = 12; points = Convert.ToDouble(Console.ReadLine()); tickets = points / costTicket; if(costGun <= tickets){ Console.WriteLine ("Buy it!"); } else{ Console.WriteLine ("Try again"); } } }
2 ответов
+ 3
Your mistake is in costGun
You make it const but you have to take it from user
+ 1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
double points, tickets;
double costGun;
const double costTicket = 12;
points = Convert.ToDouble(Console.ReadLine());
costGun = Convert.ToDouble(Console.ReadLine());
tickets = points / costTicket;
if(costGun <= tickets){
Console.WriteLine ("Buy it!");
}
else{
Console.WriteLine ("Try again");
}
}
}
}