Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace CSGO
- {
- class Program
- {
- static void Main()
- {
- var itemPrices = new Dictionary<string, int>()
- {
- { "ak47", 2700 }, { "awp", 4750 }, { "sg553", 3500 }, { "grenade", 300 }, { "flash", 250 }, { "glock", 500 }, { "bazooka", 5600 }
- };
- int N = int.Parse(Console.ReadLine());
- if (N > 7)
- {
- Console.WriteLine("Sorry, you can't carry so many things!");
- return;
- }
- int budget = int.Parse(Console.ReadLine());
- int totalCost = 0;
- for (int i = 0; i < N; i++)
- {
- string input = Console.ReadLine();
- totalCost += itemPrices[input];
- }
- int diff = 0;
- if (totalCost > budget)
- {
- diff = totalCost - budget;
- Console.WriteLine($"Not enough money! You need {diff} more money.");
- }
- else
- {
- Console.WriteLine($"You bought all {N} items! Get to work and defeat the bomb!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement