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