@templas
0 / 0 / 0
Регистрация: 09.11.2013
Сообщений: 19
|
|
|
07.12.2013, 21:35. Просмотров 449. Ответов 7
Почему не правильно вычисляется? Где у меня ошибки?
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
| #include <iostream>
#include <cmath>
using namespace std;
int main()
{
setlocale (LC_ALL, "Russian");
double k, y=0, a=10, b=1, x, xs=0, z=1, c=1, fact=1 ;
cout<<"Введите: k, x ";
cin>>k>>x;
cout.setf(ios_base::fixed, ios_base::floatfield);
cout.precision(4);
while(a<k)
{
y+=a;
cout<<y<<endl;
b+=2;
xs++;
b=b*pow(x,xs);
do
{z*=c; c++; }
while (c<=fact);
fact++;
if(xs==10||xs==13){cout<<"\nПереход на следующую итерацию цикла...\n"<<endl; continue;}
a=b/fact;
}
system ("pause >> void");
return 0;
} |
|
0
|