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