Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- // KRUG
- class Krug ()
- {
- private:
- float radius;
- const float pi = 3.14;
- public:
- Krug()
- {
- };
- Krug (float r)
- {
- this -> r = radius;
- };
- void set_r (float r)
- {
- this->r = r;
- }
- float get_r()
- {
- return this->r = r;
- }
- double get_plostina()
- {
- return this-> r * this->r * pi;
- };
- double get_perimetar()
- {
- return 2 * this-> r * pi;
- };
- int ednakvi()
- {
- if (get_plostina() == get_perimetar())
- return 1;
- else
- return 0;
- }
- ~Krug()
- {
- };
- int main()
- {
- float r;
- cin>> r;
- Krug A (r);
- cout << A.get_perimetar;
- cout << A.get_plostina;
- cout<< A.ednakvi;
- A(10);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement