LAB5_76

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; #include <cmath> int main() { int n ; cout << "Enter n" << endl ; cin >> n ; cout << "===================a==================" << endl ; double a , x; for (size_t i = 1 ; i <= n ; i++){ for (size_t j = 1 ; j <= i ; j++){ x = x + sin(j); } a = a + 1/x; } cout << "\t\t" << a << endl ; cout << "===================b==================" << endl ; a = 0 ; x = 0 ; double x1 ; for (size_t i = 1 ; i <= n ; i++){ for (size_t j = 1 ; j <= i ; j++){ x = x + sin(j); x1 = x1 + cos(j); } a = a + x1/x; } cout << "\t\t" << a << endl ; return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines