Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include <string>
- using namespace std;
- class PRISM
- {
- public:
- float a;
- float b;
- float c;
- float d;
- void przypisz()
- {
- cout << "podaj a" << endl;
- cin >> a;
- cout << "podaj b" << endl;
- cin >> b;
- cout << "podaj c" << endl;
- cin >> c;
- }
- void oblicz()
- {
- d = sqrt(a*a + b*b + c*c);
- cout << "przekatna wynosi" << endl;
- cout << d << endl;
- }
- void wypisz()
- {
- // ", " <<
- if (a>b)
- {
- if (a>c)
- {
- if (b>c)
- {
- cout << "Dlugosci bokow bryly " << "c= " << c << ", " << "b= " << b << ", " << "a= " << a << endl;
- }
- else
- {
- cout << "Dlugosci bokow bryly" << "b= " << b << ", " << "c= " << c <<", " << "a= " << a << endl;
- }
- }
- else
- {
- cout << "Dlugosci bokow bryly " << "b= " << b << ", " << "a= " << a << ", " << "c= " << c << endl;
- }
- }
- else
- {
- if (b>c)
- {
- if (a>c)
- {
- cout << "Dlugosci bokow bryly " << "c= " << c << ", " << "a= " << a << ", " << "b= " << b << endl;
- }
- else
- {
- cout << "Dlugosci bokow bryly " << "a= " << a << ", " << "c= " << c << ", " << "b= " << b << endl;
- }
- }
- else
- {
- cout << "Dlugosci bokow bryly " << "a= " << a << ", " << "b= " << b << ", " << "c= " << c << endl;
- }
- }
- }
- };
- int main()
- {
- PRISM PR;
- PR.przypisz();
- PR.oblicz();
- PR.wypisz();
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement