Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 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 ConsoleApplication23
  8. {
  9. class Rectangle
  10. {
  11. private int duljina;
  12. private int shirina;
  13.  
  14. public Rectangle()
  15. {
  16. }
  17. public Rectangle(int a, int b)
  18. {
  19. this.duljina = a;
  20. this.shirina = b;
  21. }
  22. public int Duljina
  23. {
  24. get { return this.duljina; }
  25. set { this.duljina = value; }
  26. }
  27. public int Shirina
  28. {
  29. get { return this.shirina; }
  30. set { this.shirina = value;}
  31. }
  32. public int Calc()
  33. {
  34. int lice;
  35. return lice = duljina * shirina;
  36. }
  37. }
  38. }
  39.  
  40.  
  41.  
  42. using System;
  43. using System.Collections.Generic;
  44. using System.Linq;
  45. using System.Text;
  46. using System.Threading.Tasks;
  47. using System.IO;
  48. namespace ConsoleApplication23
  49. {
  50. class Program
  51. {
  52. static void Main(string[] args)
  53. {
  54. Rectangle rect = new Rectangle();
  55. rect.Duljina = int.Parse(Console.ReadLine());
  56. rect.Shirina = int.Parse(Console.ReadLine());
  57. Console.WriteLine("Liceto na pravougulnika e:" + rect.Calc());
  58. }
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement