Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

lab4

.docx
Скачиваний:
20
Добавлен:
15.03.2015
Размер:
11.54 Кб
Скачать

// lab4.cpp : Defines the entry point for the console application.

//

#include "stdafx.h"

#include "stdio.h"

#include "math.h"

int _tmain(int argc, _TCHAR* argv[])

{

float x,z,first,per,vtor,itog,tret,pr,vt;

int i,n,a,stepen;

printf ("\n n ravno?\n");

scanf ("%d",&n);

printf ("\n x ravno?\n");

scanf ("%f",&x);

itog =0;

for(i=1;i<=n;i++){

stepen=i+1;

per=pow(-1.,stepen);

vtor=(2*i-1); tret=1/vtor;

itog=itog+per*tret;

}

first=x*itog;

vt=1;

for (i=1;i<=n;i++){

pr=(pow(i,2.)+x)/(pow(i,2.)+1);

vt=vt*pr;

}

z=first+vt;

printf ("\n z= %f \n",z);

scanf ("%f",&a);

return 0;

}

Соседние файлы в предмете Программирование