Advertisement
Guest User

tupoe govno

a guest
Jan 23rd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.13 KB | None | 0 0
  1. #include <stdio.h> // for tasks 3-5
  2. #include <stdlib.h> // for task 5
  3. #include <math.h> // for tasks 1, 2, 5
  4.  
  5. int main()
  6. {
  7.     // 1 task
  8.     double a, b, m, c;
  9.     int x, y, z, n;
  10.     y = pow(a + b, n) / (1 + a / (pow(a, m) - pow(b, m - n)));
  11.     x = ((pow(a, 3) + pow(b, 3)) / (b*c)) / sqrt(4 * a + b);
  12.     z = sqrt(abs(int(sin(x)*sin(x)))) / (3.01*x - exp(2 * x));
  13.  
  14.     // 2 task
  15.     if (abs(x) < 3)
  16.         y = pow(x, 1.0 / 5);
  17.     else
  18.         y = log(x);
  19.  
  20.     // 3 task
  21.     scanf("%d%d%d", &x, &y, &z);
  22.     if (x >= y && y >= z)
  23.     {
  24.         x >>= 1;
  25.         y >>= 1;
  26.         z >>= 1;
  27.     }
  28.     else {
  29.         x = -x;
  30.         y = -y;
  31.         z = -z;
  32.     }
  33.     printf("%d %d %d", x, y, z);
  34.  
  35.     // 4 task
  36.     int k;
  37.     scanf("%d%d", &n, &k);
  38.     int res = 0;
  39.     for (int i = k + 1; i <= n / 2 + 1; i++)
  40.     {
  41.         if (n % i == 0)
  42.             res++;
  43.     }
  44.     printf("%d", res);
  45.  
  46.     // 5 task
  47.     int mas[100];
  48.     n = rand() % 90 + 10;
  49.     int max = -1;
  50.     printf("\n");
  51.     for (int i = 0; i < n; i++)
  52.     {
  53.         mas[i] = rand() % 200 - 100;
  54.         if (abs(mas[i]) > max)
  55.             max = abs(mas[i]);
  56.         printf("%d ", mas[i]);
  57.     }
  58.     printf("\n");
  59.     for (int i = 0; i < n; i++)
  60.     {
  61.         if (mas[i] > 0)
  62.             mas[i] = max;
  63.         printf("%d ", mas[i]);
  64.     }
  65.  
  66.     return 0;
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement