Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //7 задача
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- cout << 7 +(( 5 * 3) / 2) - 4 << '\n';
- cout << (12 % 3) + (3 *3) – (4 /5) << '\n';
- cout << (4 * 5 * (5 + (6 * 2 / (6)))) ;
- return 0;
- }
- // 8 задача
- #include <iostream>
- #include <cmath>
- #include <math.h>
- #define PI 3.14
- using namespace std;
- int main()
- {
- double a, b, c, d, e, f, g, h;
- a = 2.0 / 7.0;
- b = 1.0 / 3.0 - 0.1;
- c = 5.0 * 4.0 * 3.0 * 2.0;
- d = 74.0;
- e = PI;
- f = -34.208 * pow(10, -4);
- g = (int)pow(-2, 4);
- h = sqrt(2);
- return 0;
- }
- //9 задача
- #include <iostream>
- #include <cmath>
- #include <math.h>
- using namespace std;
- int main() {
- double a = 1;
- double b = 2;
- double c = 3;
- double d = 4;
- double x = 5;
- double e = 6;
- double y = 7;
- double exampleOne = pow(a, 2) + pow(b, 2) + pow(c, 2);
- double exampleTwo = (a + b) / (c + d);
- double exampleThree = ((a + b) / c) * d;
- double exampleFour = (a + b) / (c * d);
- double exampleFive = (1 + (2 * 1) + (3 * 2 * 1)) / (1 + (1 / (2 * 1) + (1 / (3 * 2 * 1))));
- double exampleSix = (sqrt(2) + sqrt(3) + sqrt(4)) / (sqrt(5) + sqrt(6) + sqrt(7));
- double exampleSeven = sin(x) + cos(x) - (pow(tan(x) + (1 / (tan(x))), 3) / log(2 + pow(x, 4)));
- double exampleEight = log(5) / log(2) + log(7) / log(3) + log(9) / log(5);
- double exampleNinth = pow(log(0) * abs(x) + pow(e, x - 1.0), 3.0) / log(2.0 + pow(e, (x + y) / 2));
- cout << exampleOne << endl;
- cout << exampleTwo << endl;
- cout << exampleThree << endl;
- cout << exampleFour<< endl;
- cout << exampleFive << endl;
- cout << exampleSix << endl;
- cout << exampleSeven << endl;
- cout << exampleEight << endl;
- cout << exampleNine << endl;
- }
- 10 задача
- //a
- #include <iostream>
- #include <cmath>
- #include <math.h>
- using namespace std;
- int main()
- {
- int a;
- cin >> a;
- bool isDevidable = true;
- bool isNot = false;
- if (a % 3 == 0 && a % 5 == 0 || a % 2 == 0 && a % 7 == 0)
- {
- cout << isDevidable << endl;
- }
- else
- {
- cout << isNot << endl;
- }
- return 0;
- }
- //й
- #include <iostream>
- #include <cmath>
- #include <math.h>
- using namespace std;
- int main()
- {
- //й
- int a, b, c;
- cin >> a;
- cin >> b;
- cin >> c;
- bool Positive = true;
- bool Negative = false;
- if (a > 0 && b > 0 && c > 0)
- {
- cout << Positive << endl;
- }
- else
- {
- cout << Negative << endl;
- }
- return 0;
- }
- 11 задача
- #include <iostream>
- using namespace std;
- int main() {
- float radius, area_circle;
- cout << "Enter the radius of circle: ";
- cin >> radius;
- area_circle = 3.14 * radius * radius;
- cout << "Area of circle: " << area_circle << endl;
- return 0;
- }
- 12 задача
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main() {
- float a, peri, area;
- cout << "Enter value of a : ";
- cin >> a;
- peri = a * 3;
- cout << "Perimeter of Triangle : " << peri << endl;
- area = (pow(a, 2) * sqrt(3)) / 4;
- cout << "The area of the triangle is: " << area<< endl;
- return 0;
- }
- 13 задача
- #include <iostream>
- #include <cmath>
- #include <math.h>
- #define PI 3.14
- using namespace std;
- int main()
- {
- double a, b, c;
- double r, C, S, p;
- double Xa = 1;
- double Xb = 2;
- double Xc = 3;
- double Ya = 1;
- double Yb = 2;
- double Yc = 3;
- c = sqrt((pow(Xa, 2) - (2 * Xa * Xb) + pow(Xb, 2)) + (pow(Ya, 2) - (2 * Ya * Yb) + pow(Yb, 2)));
- b = sqrt((pow(Xc, 2) - (2 * Xa * Xc) + pow(Xa, 2)) + (pow(Ya, 2) - (2 * Ya * Yc) + pow(Yc, 2)));
- a = sqrt((pow(Xc, 2) - (2 * Xc * Xb) + pow(Xb, 2)) + (pow(Yc, 2) - (2 * Yc * Yb) + pow(Yb, 2)));
- p = (a + b + c) / 2;
- S = sqrt(p * (p - a) * (p - b) * (p - c));
- r = (a * b * c) / (4 * S);
- C = 2 * PI * r;
- S = PI * pow(r, 2);
- return 0;
- }
- \\14 задача а
- #include <iostream>
- #include <cmath>
- #include <math.h>
- int main()
- {
- double a, b, c, V, B, p;
- double h = 5;
- double Xa = 1;
- double Ya = 1;
- double Xb = 2;
- double Yb = 2;
- double Xc = 3;
- double Yc = 3;
- c = sqrt((pow(Xa, 2) - (2 * Xa * Xb) + pow(Xb, 2)) + (pow(Ya, 2) - (2 * Ya * Yb) + pow(Yb, 2)));
- b = sqrt((pow(Xc, 2) - (2 * Xa * Xc) + pow(Xa, 2)) + (pow(Ya, 2) - (2 * Ya * Yc) + pow(Yc, 2)));
- a = sqrt((pow(Xc, 2) - (2 * Xc * Xb) + pow(Xb, 2)) + (pow(Yc, 2) - (2 * Yc * Yb) + pow(Yb, 2)));
- p = (a + b + c) / 2;
- B = sqrt(p * (p - a) * (p - b) * (p - c));
- V = h * B;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement