Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- float F(float x) {
- if(x <= 5) return x*x + 5;
- if(x > 5 && x < 20) return 0;
- if(x >= 20) return 1;
- return 0;
- }
- void F(float x, float y) {
- cout << x << '\t' << y << endl;
- }
- int main() {
- int a, b, h;
- cout << "[a; b] = ";
- cin >> a >> b;
- cout << "h = ";
- cin >> h;
- cout << "x" << '\t' << "f(x)" << endl;
- for(int i = a; i <= b; i+=h) {
- F(i, F(i));
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement