[Fortran] 纯文本查看 复制代码 Program Www_fcode_cn Implicit None Character *5 Filename Character *4 Filename1 Integer :: I, J Integer :: A(6) Open (10, File='D:\a\year.txt') Do J = 1961, 2013 Read (10, *) Filename1 Open (J, File='D:\c\'//Filename1//'.txt') !// 11 改为 j End Do Open (12, File='D:\a\tem.txt') Do I = 1, 525 Read (12, *) Filename Open (13, File='D:\a\'//Filename//'.txt') Do J = 1961, 2013 Read (13, *) A(:) Write (A(5), *) A(:) End Do Close (13) End Do Close (12) Do J = 1961, 2013 Close (J) End Do Close (10) End Program Www_fcode_cn |
[Fortran] 纯文本查看 复制代码 program main implicit none character*5 filename character*4 filename1 integer :: i,k,j,q integer :: a(6) do q = 1961, 2013 open(10, file = "D:\a\year.txt") do i = 1, 53 read(10, *) filename1 open(11, file = "D:\c\"//filename1//".txt") open(12, file = "D:\a\tem.txt") do j = 1, 525 read(12, *) filename open(13, file = "D:\a\"//filename//".txt") do k = 1, 53 read (13, *) a(1:6) if (a(5) == q) then write(11,*) a(1:6) exit end if end do end do close(13) close(12) end do close(11) close(10) end do end 我这样写代码,然后就是不停的写,然后被替换,到最后只留下2013年的数据,这的哪里需要改一下呢? |
捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )
GMT+8, 2024-11-23 06:07