Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #define _USE_MATH_DEFINES
- #include <math.h>
- #include <cstdlib>
- void task8() {
- int x, y;
- std::cin >> x >> y;
- std::cout << pow(x, y);
- }
- void task9() {
- double num;
- std::cin >> num;
- double a, b;
- a = num * num;
- b = a * a;
- b = b * b;
- std::cout << a * b;
- }
- void task10() {
- int n;
- std::cin >> n;
- std::cout << 2 + rand() % (n - 3);
- }
- void task11() {
- int a, b;
- std::cin >> a >> b;
- std::cout << a + rand() % (b - a + 1) << std::endl << a + rand() % (b - a + 1) << std::endl << a + rand() % (b - a + 1);
- }
- void task12() {
- int a, b;
- std::cin >> a >> b;
- double f = (double)rand() / RAND_MAX;
- std::cout << a + f * (b - a);
- }
- void task14() {
- double r;
- std::cin >> r;
- std::cout << "S: " << M_PI * pow(r, 2) << "\nP: " << 2 * M_PI * r;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement