Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdexcept>
- #include <list>
- using namespace std;
- list<double> Fja (double f(double), double xmin, double xmax, double dx)
- { int duzina=xmax-xmin;
- list<double> rez;
- int i(xmin), j(0);
- while(i+j*dx<=xmax && j<duzina)
- {
- rez.push_back(f(i+j*dx));
- j++;
- }
- return rez;
- }
- int main () {
- list<double> Rez{Fja([] (double x) {return 3*x*x-5;}, 0, 10, 0.1)};
- for (auto x: Rez) cout<<x<<" ";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement