• 30 баллов. программирование в с++
    Помогите, пожалуйста ☹️

    question img

Ответы 3

  • Спасибо!!!
    • Автор:

      cocoa87
    • 6 лет назад
    • 0
  • Здравствуй дорогой друг! Не поможешь мне пожалуйста с этим? https://znanija.com/task/30081630
  • #include <iostream>

    int main()

    {

    int n, op;

    std::cout << "Enter the number of conductors" << std::endl;

    std::cin >> n;

    std::cout << "Enter operation (1 for serial or 2 for parallel)" << std::endl;

    std::cin >> op;

    double R = 0.0;

    switch (op)

    {

    case 1:

    {

     for (int i = 0; i < n; ++i)

     {

      std::cout << "Enter the resistance of a " << i + 1 << " conductor" << std::endl;

      double temp;

      std::cin >> temp;

      R += temp;

     }

     break;

    }

    case 2:

    {

     for (int i = 0; i < n; ++i)

     {

      std::cout << "Enter the resistance of a " << i + 1 << " conductor" << std::endl;

      double temp;

      std::cin >> temp;

      R += 1 / temp;

     }

     R = 1 / R;

     break;

    }

    default:

     std::cout << "Unknown operation!" << std::endl;

     break;

    }

    std::cout << "R == " << R << std::endl;

    system("pause");

    return 0;

    }

    • Автор:

      rockyxsr2
    • 6 лет назад
    • 0
  • Добавить свой ответ

Еще вопросы

Войти через Google

или

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

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

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