Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- class Triangle
- {
- private:
- int a,b,c ;
- public:
- void init() {
- cout << "Въведете страни на триъгърника:" << endl;
- cin >> a;
- cin >> b;
- cin >> c;
- }
- void output() {
- cout << a << endl;
- cout << b << endl;
- cout << c << endl;
- }
- int perimetur() {
- int per;
- per = a + b + c;
- return per;
- }
- float lice() {
- float lice;
- lice = sqrt((a + b + c)*(b + c)*(a + c)*(a + b));
- return lice;
- }
- bool ravnostranen() {
- if (a == b == c) return true;
- }
- };
- void main() {
- Triangle a1;
- setlocale(LC_ALL, "Bulgarian");
- a1.init();
- cout<<a1.perimetur()<<endl;
- cout << a1.lice() << endl;
- if (a1.ravnostranen())cout << "ebago"<<endl;
- else cout << "strugare" << endl;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement