|
[Fortran] 纯文本查看 复制代码 04 | character ( * ) :: filename |
14 | subroutine totalnum ( filename , count , nmax , sign , cnum ( ) ) |
15 | integer count , nmax , i , n , tonum |
16 | character * 1 buffer ( 1 : nmax ) |
17 | character ( * ) :: filename |
19 | character , allocatable :: string ( : ) |
20 | integer , allocatable :: cnum ( : ) |
21 | open ( 10 , FILE = filename ) |
26 | READ ( 10 , 100 ) string ( n ) |
32 | if ( ( buffer ( i ) == sign ) .AND. ( buffer ( i +1 ) /= sign ) ) cnum ( n ) = cnum ( n ) +1 |
37 | end subroutine totalnum |
48 | open ( 10 , file = filename , status = 'old' ) |
50 | read ( 10 , * , iostat = error ) line |
64 | call totalnum ( filename , count , nmax , sign , cnum ( n ) ) |
|
|