• ПОМОГИТЕ ПОЖАЛУЙСТА С ИНФОРМАТИКОЙ, НАДО НАПИСАТЬ ВСЁ НА ЯЗЫКЕ СИ

    question img

Ответы 3

  • 2,3,4 не правильные
    • Автор:

      bowers
    • 5 лет назад
    • 0
  • Да, в 4 я допустил несколько опечаток, но 2 и 3 верные. Вот верное решение 4: #include int main() { int n = 0, p; int sum = 0; do { p = n; scanf("%d", &n); sum += n; } while (n != 0); printf("sum = %d, prev = %d", sum, p); return 0;}
    • Автор:

      patsy
    • 5 лет назад
    • 0
  • Решения задач. (компилируется на MinGW GCC 8.1)z1:#include <stdio.h> // Ввод-вывод#include <math.h> // Математические функцииdouble abs_double(double x) { return x < 0 ? -x : x;}int main() { double K, L, x, T, Q; scanf("%lf %lf %lf", &K, &L, &x); T = pow(cos(x)*(pow(K, 2) - pow(L, 2), 2) / (K * L * x); Q = sqrt(pow(T, 2) * abs_double(K - L) / 0.25); printf("T = %f, Q = %f", T, Q); return 0;}z2:#include <stdio.h> // Ввод-вывод#include <math.h> // Математические функцииdouble max(double a, double b) { return a > b ? a : b;}int main() { double a, n, l, x1, x2, y, z; scanf("%lf %lf %lf", &a, &n, &l); x1 = (a + n) / pow(a - l, 2); x2 = a / (n * l); if (x1 == x2) {  y = x1 * (a - n) / x2; } else if (x1 < x2) {  y = x1 + x2; } else {  y = a * x1 + n * x2; } z = max(x1, x2) / (x1 + x2); printf("x1 = %f, x2 = %f, y = %f, z = %f", x1, x2, y, z); return 0;}z3:#include <stdio.h>#include <math.h>int main() { double x; double y = 0; scanf("%lf", &x); for (int i = 1; i <= 11; i += 2) {  y += pow((x - 1) / (x + 1), i) / i; } printf("Y = %f", y);}z4:#include <stdio.h>int main() {int n = 0, p;int sum = 0;do {p = n;scanf("%d", &n);sum += n;} while (n != 0);printf("sum = %d, prev = %d", sum, p);return 0;}z5:#include <math.h>#include <stdio.h>int main() { const double PI = 3.141592; double a; int b; scanf("%lf %d", &a, &b); double x, d, S, s; if (b == 1) {  x = a;  d = x * sqrt(2);  S = pow(d / 2, 2) * PI;  s = pow(x / 2, 2) * PI; } else if (b == 2) {  d = a;  x = d / sqrt(2);  S = pow(d / 2, 2) * PI;  s = pow(x / 2, 2) * PI; } else if (b == 3) {  S = a;  d = 2 * sqrt(S / PI);  x = d / sqrt(2);  s = pow(x / 2, 2) * PI; } else if (b == 4) {  s = a;  x = 2 * sqrt(s / PI);  d = x * sqrt(2);  S = pow(d / 2, 2) * PI; } else {  printf("error");  return 0; } printf("x = %f, d = %f, s = %f, S = %f", x, d, s, S); return 0;}
  • Добавить свой ответ

Войти через Google

или

Забыли пароль?

У меня нет аккаунта, я хочу Зарегистрироваться

How much to ban the user?
1 hour 1 day 100 years