#include #include using namespace std; class konus { public: float kattaR; float kichikR; float yasovchiL; float yuza; float hajm; void show() { cout << "Yuza :" << yuza << endl; cout << "Hajm :" << hajm; } }; int main() { konus a; cout << "katta radius :"; cin >> a.kattaR; cout << "kichik radius :"; cin >> a.kichikR; cout << "yasovchi :"; cin >> a.yasovchiL; a.yuza = M_PI * (pow(a.kattaR,2) + (a.kattaR + a.kichikR) + pow(a.kichikR,2)); a.hajm = M_PI * (pow(a.kattaR,2) + (a.kattaR * a.kichikR) + pow(a.kichikR,2)) * 1 / 3; a.show(); return 0; }
Do'stlaringiz bilan baham: |