Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 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 Mogeashvili_Lesson_1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Console.WriteLine("Привет!");
  14. Console.WriteLine();
  15. string debit = "";
  16. Console.Write("Введите доход: ");
  17. debit = Console.ReadLine();
  18. Console.WriteLine("Ваш доход: " + debit);
  19.  
  20. Console.WriteLine();
  21. string credit = "";
  22. Console.Write("Введите расход: ");
  23. credit = Console.ReadLine();
  24. Console.WriteLine("Ваш расход: " + credit);
  25.  
  26. int debitInt = 0;
  27. int creditInt = 0;
  28.  
  29. int.TryParse(debit, out debitInt);
  30. int.TryParse(credit, out creditInt);
  31.  
  32. int balance = debitInt - creditInt;
  33.  
  34. Console.WriteLine();
  35. Console.WriteLine("Ваш баланс: "+ balance);
  36. Console.ReadKey();
  37.  
  38. Console.ReadKey();
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement