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 gold;
- int crystal;
- int crystalPrice = 10;
- bool notEnoughGold;
- Console.Write("Введите ваше количество золота: ");
- gold = Convert.ToInt32(Console.ReadLine());
- Console.Write("Сегодняшняя цена кристаллов " + crystalPrice + " сколько вы хотите купить ");
- crystal = Convert.ToInt32(Console.ReadLine());
- notEnoughGold = gold >= crystal * crystalPrice;
- crystal *= Convert.ToInt32(notEnoughGold);
- gold -= crystalPrice * crystal;
- Console.WriteLine("Ваше количество золота: " + gold + " и кристаллов: " + crystal);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment