Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. class number
  2. {
  3. private int _age;
  4.  
  5. public int sum;
  6.  
  7. public int age {
  8. set { value = _age; }
  9. get { return _age; }
  10. }
  11. private int _num;
  12. public int num { set { value = _num; } get { return _num; } }
  13. public int cal()
  14. {
  15. sum = _age +_num;
  16. return sum;
  17. }
  18.  
  19. }
  20. class Program
  21. {
  22. static void Main(string[] args)
  23. {
  24. int a, b;
  25. a = Convert.ToInt32(Console.ReadLine());
  26. b = Convert.ToInt32(Console.ReadLine());
  27. number kj = new number();
  28. kj.age=a;
  29. kj.num=b;
  30. Console.WriteLine(kj.cal());
  31.  
  32. Console.ReadKey();
  33.  
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement