Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4. float a,b;
  5. float f(float x)
  6. {
  7. return x*x-sin(x);
  8. }
  9. int main()
  10. {
  11. int j=0;
  12. float integrala=0;
  13. cin>>a>>b;
  14. for(j=1; j<=10000; j++)
  15. integrala=integrala+f((float)(((b-a)*j)/20000)*(float)((b-a)/10000));
  16. cout<<integrala;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement