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