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 CSlight
- {
- class Program
- {
- static void Main(string[] args)
- {
- int money;
- int crystal;
- int crystalPrice = 5;
- bool countMoney;
- Console.Write("Ведите количество золота: ");
- money = Convert.ToInt32(Console.ReadLine());
- Console.Write("Сколько кристаллов вы хотите купить ? Стоимость одного кристала равна 5 ");
- crystal = Convert.ToInt32(Console.ReadLine());
- countMoney = money >= crystalPrice * crystal;
- crystal *= Convert.ToInt32(countMoney);
- money -= crystalPrice * crystal;
- Console.WriteLine("Денег осталось: " + money + " Вы купили: " + crystal + " Кристалов");
- }
- }
- }
Add Comment
Please, Sign In to add comment