Don't like ads? PRO users don't see any ads ;-)

Untitled

By: a guest on May 17th, 2012  |  syntax: None  |  size: 1.21 KB  |  hits: 23  |  expires: Never
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
1. program mass;
2. var
3. a,b:array[1..18,1..18] of extended;
4. x:array[1..18] of extended;
5. i,j,k:integer;
6. y,s,l,s1:extended;
7. begin
8. for i:=1 to 18 do
9.          for j:=1 to 18 do
10.              begin
11.                   a[i,j]:=(Exp(j*Ln(i))-Exp(i*Ln(j)))/(i*j);
12.                   b[i,j]:=a[i,j];
13.              end;
14. writeln('massiv a ');
15. for i:=1 to 18 do
16. begin
17. writeln('stroka N ',i);
18. for j:=1 to 18 do
19. begin
20. write(a[i,j]:8:2,' ');
21. end;
22. writeln;
23. end;
24.
25.
26.
27. s:=0;
28. for i:=1 to 18 do
29.  begin
30.   for j:=1 to 18 do
31.    begin
32.     s:=s+a[i,j];
33.    end;
34.   b[i,i]:=s;
35.   s:=0;
36.  end;
37. for i:=1 to 18 do
38.  begin
39.   for j:=1 to 18 do
40.    begin
41.     x[i]:=x[i]+b[i,j]*b[j,i];
42.    end;
43.    writeln('x[',i,']=',x[i]:6:2);
44.  end;
45.
46.
47.
48. for k:=1 to 9 do
49.   for i:=1 to 17 do
50.     for j:=i+1 to 18 do
51.      begin
52.       if a[k*2,i]<a[k*2,j] then
53.        begin
54.         l:=a[k*2,i];
55.         a[k*2,i]:=a[k*2,j];
56.         a[k*2,j]:=l;
57.        end;
58.      end;
59.
60. writeln('uporyadochennii massiv a ');
61. for i:=1 to 18 do
62. begin
63. writeln('stroka N ',i);
64. for j:=1 to 18 do
65. begin
66. write(a[i,j]:8:2,' ');
67. end;
68. writeln;
69. end;
70.
71.
72. y:=1;
73. s1:=0;
74. for i:=1 to 18 do
75.  begin
76.   y:=y*x[i];
77.   s1:=s1+x[i];
78.  end;
79. y:=y+s1;
80. writeln('y=',y:8:4);