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 HomeWorck_4_3
- {
- class Program
- {
- static void Main(string[] args)
- {
- int myGold = 0;
- int amountCrystals;
- int crystalPrice = 2;
- Console.WriteLine("Сколько дед отставил золота вам в наследство?");
- myGold = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine($"Сколько вы хотите купить кристаллов за это золото? " +
- $"--- Обменный курс: 1 кристалл за {crystalPrice} золота ---");
- amountCrystals = Convert.ToInt32(Console.ReadLine());
- myGold -= amountCrystals * crystalPrice;
- Console.WriteLine("Вы получили: " + amountCrystals + " кристаллов" + "\n" +
- "У вас осталось: " + myGold + " золото");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement