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 ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- int gold;
- int crystals;
- int price = 50;
- int residue;
- Console.Write("Введите начальное количество золота = ");
- gold = Convert.ToInt32(Console.ReadLine());
- crystals = gold / price;
- Console.Write("Вы можете купить до " + crystals + " кристаллов. Сколько вы бы хотели приобрести? ");
- crystals = Convert.ToInt32(Console.ReadLine());
- residue = gold - (crystals * price);
- Console.WriteLine("Количество купленных кристаллов: " + crystals);
- Console.WriteLine("Количество оставшегося золота: " + residue);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement