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