@ForEveR
В астрале
7989 / 4748 / 321
Регистрация: 24.06.2010
Сообщений: 10,547
|
03.10.2010, 23:17
|
|
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| #include <cmath>
#include <conio.h>
#include <iostream>
using namespace std;
int main()
{
double x;
cout << "x = ";
cin >> x;
double n;
cout << "n = " ;
cin >> n;
double S=1;
for (int i=1; i<=n; i++)
S+=pow(x,i);
cout << "S = " << S;
getch();
} |
|
1
|