program prog
dimension A(5,5), C(5)
integer A,i,j, min,max,R,C
logical fl
R=70
A(1,1) = 1
A(1,2) = -4
A(1,3) = 5
A(1,4) = -1
A(1,5) = 6
A(2,1) = 4
A(2,2) = -9
A(2,3) = -1
A(2,4) = 3
A(2,5) = -1
A(3,1) = 7
A(3,2) = -1
A(3,3) = 9
A(3,4) = 2
A(3,5) = -1
A(4,1) = -9
A(4,2) = 3
A(4,3) = -8
A(4,4) = -6
A(4,5) = -4
A(5,1) = 5
A(5,2) = 3
A(5,3) = 1
A(5,4) = 7
A(5,5) = -6
fl = .true.
do i = 1,5
max = A(i,1)
min = A(i,1)
do j = 2,5
if (A(i,j)> max) then
max = A(i,j)
endif
if (A(i,j) < min) then
min = A(i,j)
endif
enddo
fl = fl .and. (max - min <=R)
enddo
if (fl) then
!формируем массив С
do i=1,5
C(i) = A(i,i)
enddo
endif
print "(A,5(I3,x))",'massiv C: ', C
read *
end program prog
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.