а) Код программы:
#include <iostream>
#include <locale>
#include <time.h>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int n;
double sum = 0;
for (n = 1; n <= 9; n++) {
sum += 19. * n / (3 + n + n * n);
}
cout << sum << endl;
б) Код программы:
int t;
for (t = 3; t <= 3; t++) {
sum += tan(t + 3) / (t*t*t + 2 * t + exp(t - 1));
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
а) Код программы:
#include <iostream>
#include <locale>
#include <time.h>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int n;
double sum = 0;
for (n = 1; n <= 9; n++) {
sum += 19. * n / (3 + n + n * n);
}
cout << sum << endl;
}
б) Код программы:
#include <iostream>
#include <locale>
#include <time.h>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int t;
double sum = 0;
for (t = 3; t <= 3; t++) {
sum += tan(t + 3) / (t*t*t + 2 * t + exp(t - 1));
}
cout << sum << endl;
}