Essays.club - Получите бесплатные рефераты, курсовые работы и научные статьи
Поиск

Контрольная работа по "Информатике"

Автор:   •  Октябрь 28, 2022  •  Контрольная работа  •  312 Слов (2 Страниц)  •  95 Просмотры

Страница 1 из 2

1)#include <iostream>

#include <cmath>

using namespace std;

int main() {

int x, n;

double s;

n=1;

x=1;

while (n<10) {

n+=2;

s+=x+(pow(x,n))/n;

}

cout<<"s="<<s;

}

Ответ: s=5.87821

2)#include <iostream>

#include <cmath>

using namespace std;

int main() {

int x, n;

double s;

n=1;

x=1;

while (n<10) {

n+=2;

s+=x-(pow(x,n))/n;

}

cout<<"s="<<s;

}

Ответ: s=5.87821

3)#include <iostream>

#include <cmath>

using namespace std;

int main() {

int x, n;

double s;

n=1;

x=1;

while (n<10) {

n+=3;

s+=x+(pow(x,n))/n;

}

cout<<"s="<<s;

}

Ответ: s=3.49286

4)#include <iostream>

#include <cmath>

using namespace std;

int main()

{

int n;

double s=0;

cout << "n = ", cin >> n;

for (int i=1; i<=n; i++) s += (double)1/pow(i,i);

cout << s;

return 0;

}

Ответ:

...

Скачать:   txt (1.8 Kb)   pdf (36.3 Kb)   docx (8.5 Kb)  
Продолжить читать еще 1 страницу »
Доступно только на Essays.club