Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace DartsTournament
- {
- class Program
- {
- static void Main(string[] args)
- {
- int startPoints = int.Parse(Console.ReadLine());
- int moves = 0;
- while (startPoints > 0)
- {
- string command = Console.ReadLine();
- moves++;
- if (command == "bullseye")
- {
- break;
- }
- int points = int.Parse(Console.ReadLine());
- if (command == "double ring")
- {
- points *= 2;
- }
- else if (command == "triple ring")
- {
- points *= 3;
- }
- startPoints -= points;
- }
- if (startPoints == 0)
- {
- Console.WriteLine($"Congratulations! You won the game in {moves} moves!");
- }
- else if (startPoints < 0)
- {
- Console.WriteLine($"Sorry, you lost. Score difference: {Math.Abs(startPoints)}.");
- }
- else
- {
- Console.WriteLine($"Congratulations! You won the game with a bullseye in {moves} moves!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement