Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <math.h>
- using namespace std;
- int main (void)
- {
- ifstream ins("input.txt");
- float S=0;
- int n;
- float x;
- ins >> n >> x; // 3 2
- float k;
- k=x;
- for (int i=1; i<=n; i++)
- {
- S+=sin(k);
- k*=x;
- }
- cout << S << endl; //1.14185
- }
Advertisement
Add Comment
Please, Sign In to add comment