.


:




:

































 

 

 

 


Excel




, Excel:

1: =($E$6-$B$6*B11-$C$6*C11)/$A$6;

2: =($E$7-$A$7*A12-$C$7*C11)/$B$7;

1: =($E$8-$A$8*A12-$B$8*B12)/$C$8;

:

=(ABS(A12-A11);ABS(B12-B11);ABS(C12-C11));

:

=(D12<$D$10;"";"").

Excel:

:

 
 


xk+1,0=(b0-a01xk1-a02xk2)/a00

 
 

         
 
 
   
 
   


:

 

#include <stdio.h>

#include <conio.h>

#include <math.h>

int main()

{int a[3][3]={{4,-2,3},{2,3,1},{3,2,-5}}, i,j; float max;

int b[3]={14,-16,-8};

printf("massiv a[3][3]:");

for (i=0; i<3; i++)

{

printf("\n\n");

for (j=0; j<3; j++)

printf ("%d ", a[i][j]);

}

printf("\n\n\n");

printf("massiv b[3]:");

printf("\n\n");

for (i=0; i<3; i++)

printf("%d ", b[i]);

int k=0;

float x[42][3];

for (i=0; i<3; i++)

x[k][i]=0;

do {

x[k+1][0]=(b[0]-a[0][1]*x[k][1]-a[0][2]*x[k][2])/a[0][0];

x[k+1][1]=(b[1]-a[1][0]*x[k+1][0]-a[1][2]*x[k][2])/a[1][1];

x[k+1][2]=(b[2]-a[2][0]*x[k+1][0]-a[2][1]*x[k+1][1])/a[2][2];

float d[3];

for (i=0; i<3; i++)

d[i]=fabs(x[k+1][i]-x[k][i]);

for (i=0; i<3; i++)

{

max=d[0];

if (d[i+1]>max)

max=d[i+1];}

k++;

} while (max>0.000001);

printf("\n\n\n");

printf("vector resheniya X[3]:");

printf("\n\n");

for (i=0; i<3; i++)

printf("%f ", x[k][i]);

float s[3];

for (i=0; i<3; i++)

s[i]=0;

for (i=0; i<3; i++)

{

for(j=0; j<3; j++)

s[i]=s[i]+x[k][j]*a[i][j];

}

printf("\n\n\n");

printf("Proverka:");

printf("\n\n");

for (i=0; i<3; i++)

printf("%.0f ", s[i]);

getch();

}

 

:

 

 

 

- , . Excel , ABS, .

, : . , , , (.. 0,000001). , .. b[3] for, , .

 

 

1. ., . = TheCprogramminglanguage. 2-. .: , 2007. . 304.

2. C: , = C: TheCompleteReference, 4thEdition. .: , 2010. . 704.

3. . : = C Primer Plus. 1- . .: , 2006. . 960.

4. . = Programming in C. 3- . .: , 2006. . 496.

5. . = C For Dummies. .: , 2006. . 352.

6. http://vplaksina.narod.ru/uchebnik/algoritm.htm

 

 





:


: 2015-10-01; !; : 346 |


:

:

. .
==> ...

1494 - | 1453 -


© 2015-2024 lektsii.org - -

: 0.011 .