Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main(){
- int n = 0, k = 0;
- int fact = 0;
- float sum1 = 0;
- float sum2 = 0;
- for( k = 1; k <= 10; k++ ){
- sum2 = 0;
- for( n = 1; n <= k; n++ ){
- sum2 += sin( k * n );
- }
- fact = 1;
- for( int i = 1; i <= k; i++ ){
- fact *= i;
- }
- sum1 += ( sum2 / fact );
- }
- cout << sum1 << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement