Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h> // for tasks 3-5
- #include <stdlib.h> // for task 5
- #include <math.h> // for tasks 1, 2, 5
- int main()
- {
- // 1 task
- double a, b, m, c;
- int x, y, z, n;
- y = pow(a + b, n) / (1 + a / (pow(a, m) - pow(b, m - n)));
- x = ((pow(a, 3) + pow(b, 3)) / (b*c)) / sqrt(4 * a + b);
- z = sqrt(abs(int(sin(x)*sin(x)))) / (3.01*x - exp(2 * x));
- // 2 task
- if (abs(x) < 3)
- y = pow(x, 1.0 / 5);
- else
- y = log(x);
- // 3 task
- scanf("%d%d%d", &x, &y, &z);
- if (x >= y && y >= z)
- {
- x >>= 1;
- y >>= 1;
- z >>= 1;
- }
- else {
- x = -x;
- y = -y;
- z = -z;
- }
- printf("%d %d %d", x, y, z);
- // 4 task
- int k;
- scanf("%d%d", &n, &k);
- int res = 0;
- for (int i = k + 1; i <= n / 2 + 1; i++)
- {
- if (n % i == 0)
- res++;
- }
- printf("%d", res);
- // 5 task
- int mas[100];
- n = rand() % 90 + 10;
- int max = -1;
- printf("\n");
- for (int i = 0; i < n; i++)
- {
- mas[i] = rand() % 200 - 100;
- if (abs(mas[i]) > max)
- max = abs(mas[i]);
- printf("%d ", mas[i]);
- }
- printf("\n");
- for (int i = 0; i < n; i++)
- {
- if (mas[i] > 0)
- mas[i] = max;
- printf("%d ", mas[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement