Я видел Мои ошибки.Инструкции, которые я дал компилятору Фортрана, были результатом, который я получил в моем текстовом файле вывода.Я объявлял две-2 строки (1,2) и (3,4,5,6);вместо объявления трех-трех столбцов (1,2);(3,4) и (5,6).Ниже приведены правильные строки кодов для получения желаемых выходных данных.
Lines of Codes:
Program Format2
!illustrates formatting Your Output
Implicit None
Integer:: B(2,3)
Integer:: k,j
!Open Output Text File at Machine 8
Open(8,file="formatoutput2.txt")
Data B/1,2,3,4,5,6/
!(a)Declare The 1st Two-2 Values You want for k Two-2 Rows, that is (1 and 2)
!(b)Note, doing (a), automatically declares the values in Column 1, that is (1 and 2)
Do k= 1,2
B(2,3)= k
End Do
!(c)Next, Declare, the Four Values You want in Column 2 and Column 3. That is [3,4,5,6]
!(d) Based on (c), We want 3 and 4 in "Column 2"; while "Column 3", gets 5 and 6.
Do j= 3,6
B(2,3)= j
End Do
!Write to File at Machine 8 and show the formatting in Label 13
Write(8,13) ((B(k,j),j= 1,3),k= 1,2)
13 format(3i3)
End Program Format2
The Above Lines of Codes, gives the Desired Output below:
1 3 5
2 4 6