#include <iostream>#include <clocale>#include <math.h>   using namespace std;   int main (){    setlocale(LC_ALL, "Russian");   int x,n;float eps;cout << " Введите x  "<<endl;cin >> x;cout << " Введите n  "<<endl;cin >> n;   cout <<"введи точность \n"<<endl;float s=0,t=0,f=1;   for (int i=0;i<n;i++){f=1;   cin >>eps;float sumeps=0;   for (int i=0;i<n;i++){f=1;   for(int j=1; j<i*2+1; j++)if (j%2!=0) f=f*j;else f=f/j;t = (pow ((float)x,i*2+1) / (float)(i*2+1))*f;if (abs(t)<eps/2) sumeps+=t;s=s+t;}}   cout << " Сумма n элементов = "<< s << endl;   cout << " arcsin(x) = "<< asin((float)x) << endl;   return 0;}
  ks
№ 1 | Автор:  ksuha94 |
 2013-05-24, 14:54  | Изменено:  ksuha94 -  Пт, 2013-05-24, 14:55
 
| 
 Репутация:  [ + 0 ] 
  
 |  
| 
 | 
  
 |