Advertisement
dxoraxs

Untitled

Apr 9th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace homework
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.Write("Введите количество вашего золота: ");
  14.             int gold = Convert.ToInt32(Console.ReadLine());
  15.             int crystal = 0;
  16.             const int costCrystal = 10;
  17.            
  18.             Console.WriteLine("\n- Сколько вы хотите купить у меня кристаллов по цене "+costCrystal+" золотых за единицу?");
  19.             int numberCrystal = Convert.ToInt32(Console.ReadLine());
  20.             gold -= costCrystal * numberCrystal;
  21.             crystal += numberCrystal;
  22.             Console.WriteLine("\nВаше золото: "+ gold+"\nВаши кристаллы: "+ crystal);
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement