Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
21
Task/File-input-output/Fortran/file-input-output.f
Normal file
21
Task/File-input-output/Fortran/file-input-output.f
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
program FileIO
|
||||
|
||||
integer, parameter :: out = 123, in = 124
|
||||
integer :: err
|
||||
character(len=1) :: c
|
||||
|
||||
open(out, file="output.txt", status="new", action="write", access="stream", iostat=err)
|
||||
if ( err == 0 ) then
|
||||
open(in, file="input.txt", status="old", action="read", access="stream", iostat=err)
|
||||
if ( err == 0 ) then
|
||||
err = 0
|
||||
do while ( err == 0 )
|
||||
read(unit=in, iostat=err) c
|
||||
if ( err == 0 ) write(out) c
|
||||
end do
|
||||
close(in)
|
||||
end if
|
||||
close(out)
|
||||
end if
|
||||
|
||||
end program FileIO
|
||||
Loading…
Add table
Add a link
Reference in a new issue