Advertisement
Briotar

Homework 1.1

Apr 12th, 2021
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 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 Lesson1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int sumGold;
  14. int quantityOfGoods;
  15. int costCrystals = 5;
  16. bool flag;
  17. Console.WriteLine("Добрый день. Сколько у вас золота?");
  18. sumGold = Convert.ToInt32(Console.ReadLine());
  19. Console.WriteLine("Сколько кристаллов вы хотели бы приобрести?");
  20. quantityOfGoods = Convert.ToInt32(Console.ReadLine());
  21. sumGold = sumGold - quantityOfGoods * costCrystals;
  22. Console.WriteLine($"У вас в сумке - {quantityOfGoods} кристаллов. У вас осталось - {sumGold} золота");
  23.  
  24.  
  25.  
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement