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 Lesson1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int sumGold;
- int quantityGoods;
- int costCrystals = 5;
- Console.WriteLine("Добрый день. Сколько у вас золота?");
- sumGold = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Сколько кристаллов вы хотели бы приобрести?");
- quantityGoods = Convert.ToInt32(Console.ReadLine());
- sumGold = sumGold - quantityGoods * costCrystals;
- Console.WriteLine($"У вас в сумке - {quantityGoods} кристаллов. У вас осталось - {sumGold} золота");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement