Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. class Triangle
  5. {
  6. private:
  7. int a,b,c ;
  8. public:
  9. void init() {
  10. cout << "Въведете страни на триъгърника:" << endl;
  11. cin >> a;
  12. cin >> b;
  13. cin >> c;
  14. }
  15.  
  16. void output() {
  17. cout << a << endl;
  18. cout << b << endl;
  19. cout << c << endl;
  20. }
  21. int perimetur() {
  22. int per;
  23. per = a + b + c;
  24. return per;
  25. }
  26. float lice() {
  27. float lice;
  28. lice = sqrt((a + b + c)*(b + c)*(a + c)*(a + b));
  29. return lice;
  30. }
  31. bool ravnostranen() {
  32. if (a == b == c) return true;
  33.  
  34. }
  35. };
  36. void main() {
  37. Triangle a1;
  38. setlocale(LC_ALL, "Bulgarian");
  39. a1.init();
  40. cout<<a1.perimetur()<<endl;
  41. cout << a1.lice() << endl;
  42. if (a1.ravnostranen())cout << "ebago"<<endl;
  43. else cout << "strugare" << endl;
  44. system("pause");
  45.  
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement