Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- double y(double x)
- {
- if ((x>=0)&&(x!=1)) return (-1/(1-x));
- else if ((x<0)&&(x!=-1)) return (1/(1+x));
- else return 1;
- }
- int main (void)
- {
- ifstream ins("p49.txt");
- ofstream ous("ans49.txt");
- double a,b,h;
- ins >> a >> b >> h;
- for (double i=a; i<=b; i+=h)
- ous << i << " " << y(i) << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment