Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //2.1
- /*#include <iostream>
- #define _USE_MATH_DEFINES
- #include <math.h>
- using namespace std;
- double V,R,r,h,S,l;
- int main()
- {
- cout<<"Enter nums"<<endl;
- cin>>r>>R>>h;
- if (h >0 and R>0 and r>0){
- l=sqrt((h*h+pow((R-r),2)));
- V = (M_PI * h * (pow(R, 2) + R * r + pow(r, 2)) / 3);
- S = M_PI * (pow(R, 2) + (R + r) * l + pow(r, 2));
- cout << S << " " << V;
- }
- else{
- cout<<"Введите числа больше нуля";
- }
- return 0;
- }*/
- //2.2
- /*#include <iostream>
- #define _USE_MATH_DEFINES
- #include <math.h>
- using namespace std;
- float w,a,x;
- int main()
- {
- cout<<"Enter nums"<<endl;
- cin >> x>>a;
- if (x==0){
- cout<<"Error"<<endl;
- }
- else {
- if (abs(x) < 1) {
- w = a * log(abs(x));
- cout << abs(w);
- }
- else {
- if (a - pow(x, 2) < 0) {
- cout << "error\n";
- }
- else {
- w = sqrt(a - pow(x, 2));
- cout << abs(w);
- }
- }
- }
- return 0;
- }*/
Advertisement
Add Comment
Please, Sign In to add comment