.


:




:

































 

 

 

 


3

.

N(>0).

:

// 3_1.cpp: .

//

 

#include "stdafx.h"//

#include "iostream"//

#include "math.h"//

using namespace std;//

int main()//

{ //

setlocale(LC_ALL, "Rus");// ;

int n,i;//

double x;//

x=0;//

cout<<" n";//

cin>>n;//

for(i=1; i<=n; i++);// 1, n +i

{//

x=x+(2*(i*i));//

}//

cout<<"x="<<x<<"\n";//

system("PAUSE");//

return 0;// main

}//

:

2) C++

y=

[-7,4;0,6]

0.16

:

// 3_2.cpp: .

//

 

#include "stdafx.h"//

#include "iostream" //

#include "math.h" //

#include "clocale"

using namespace std; //

int main() //

{ //

setlocale(LC_ALL, "Rus"); // ;

double xn,xk,xh,a,x,y;//

cout<<" a:";//

cin>>a;//

xn=-7.4;//

xk=0,6;//

xh=0.16;//

x=xn;

while(x<=xk)//

{//

if(x<=0) y=(sin(x*x*x+1)/cos(x*x*x+1));//

else//

if((x>0)&&(x<=a)) y=log((sin(x)+1)*(sin(x)+1));//

else//

if(x>a) y=pow(2*(x*x)+(x*x*x*x)+1,1/3);//

cout<<"x="<<x<<"y="<<y<<"\n";//

x=x+xh;

}//

system("PAUSE");//

return 0;;// main

}//

:

3) y(x) x, a=0,1 b=1,2 h=0,1.

:

// 3_3.cpp: .

//

 

#include "stdafx.h"//

#include "iostream"//

#include "math.h"//

#include "clocale"//

using namespace std;//

int main()//

{//

setlocale (LC_ALL, "RUS");//

double s,x,a,b,h;//

int n,i;//

a=0.1;// a

b=1.2;// b

h=0.1;// h

n=20;// n

x=a;

do// x

{//

s=0;// k=0

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

s+=((i*(x/4))/(i*i));

cout<<"x="<<x<<"s="<<s<<"\n";//

x+=h;// x h

}//

while(x<=b+h/2);//

system("PAUSE");//

return 0;// main

}//

:



<== | ==>
. : |
:


: 2016-09-03; !; : 406 |


:

:

: , , , , .
==> ...

1499 - | 1374 -


© 2015-2024 lektsii.org - -

: 0.011 .