• Перевести программу с Pascal на С.
    var
    x, sum, s: real;
    i, n: integer;
    begin
    sum := 0;
    read(n, x);
    s := 1;
    for i := 1 to n do
    begin
    s := s * sin(x);
    sum := sum + s;
    end;
    writeln(sum);
    end.

Ответы 1

  • #include <iostream>#include <math.h>using namespace std;int main(){    float x, sum, s;    int i, n;    sum=0;    cout << "n - ";    cin >> n;    cout << "x - ";    cin >> x;    s=1;    for(i=1; i<=n; i++){        s = s*sin(x);sum=sum+s;    }    cout << sum;    return 0;}
    • Автор:

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

Войти через Google

или

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

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

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