Seal_of_approval

p59

Dec 15th, 2014
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <math.h>
  4. using namespace std;
  5. int main (void)
  6. {
  7. ifstream ins("input.txt");
  8. float S=0;
  9. int n;
  10. float x;
  11. ins >> n >> x; // 3 2
  12. float k;
  13. k=x;
  14. for (int i=1; i<=n; i++)
  15. {
  16. S+=sin(k);
  17. k*=x;
  18. }
  19. cout << S << endl; //1.14185
  20. }
Advertisement
Add Comment
Please, Sign In to add comment