Or just read it here... ;)
PROGRAM mittelwert
! Variablen-Deklaration
IMPLICIT NONE
REAL :: zahl, summe, mittw
CHARACTER (LEN = 128) :: datnam
INTEGER :: i, n, fehler
integer :: ii, jj, k
character*80 :: line ! the line buffer
integer, parameter :: linemax=50...
Thank you very much for your help.
I solved the problem in another way now.
If you want to take a look on it, you can find it on the following URL:
http://www.students.uni-mainz.de/sveneier/Fortran90%20(Quellcode+Programme)
Best wishes and bye!
Is there a way to store the index ii after which the line ends, so the sum can just go ip to this one.
I tried this, but - no surprise - it doesn't work...
(Hope you understand, waht I mean)
[CODE]
read (line, *, end=888) (val(ii), ii = 1, linemax)
k = ii !k is that ii where the line...
There is one problem left:
(val(ii), ii = 1, linemax) has the effect, that all the lines with less values are filled with the additional values of the longest one.
So I have to erase the values val(ii) after one "sum-loop"
(do jj = 1, ii - 1
summe = summe + val(jj)
n = n + 1)...
Hello!
Here's my problem:
I don't know in which way I have to change these lines, to get a program which doesn't skip into the next line after the first value that has been readed.
Any line should be read till its end and contemporary the values should be counted.
Here are the lines:
DO...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.