eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

Табулювання функції

опубліковано 10.04.24, 14:38:51

include <iostream>

include <cmath>

using namespace std; int main() { double a,b,h; cin>>a>>b>>h;

for (double x = a; x <= b; x += h) {
    double y = 3 * sin(x);
    printf("%.3lf %.3lf\n",x,y);
}

return 0;

}

опубліковано 13.04.24, 16:46:34

include <bits/stdc++.h>

using namespace std;

int main(){

int a,b;

double h;

cin>>a>>b>>h;

for(double i=a;i<=b;i+=h)

{

double y=3*sin(i);

cout<<fixed<<setprecision(3)<<i<<" "<<y<<endl;

}

}