Advertisement
Guest User

Untitled

a guest
Dec 5th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program test
  2.     use iso_fortran_env, only: int64, real64
  3.     implicit none
  4.  
  5.     integer :: i
  6.     integer(int64) :: t0, t1, rate
  7.     real(real64) :: dt
  8.     character(len=50000) :: str
  9.     character, allocatable :: str_array(:)
  10.  
  11.     read(*,"(a)") str
  12.  
  13.     call system_clock(t0, rate)
  14.  
  15.     str_array = [(str(i:i), i = 1, len(str))]
  16.     str_array = pack(str_array, str_array /= " ")
  17.  
  18.     call system_clock(t1, rate)
  19.  
  20.     dt = (t1 - t0)/(1.0d0*rate)
  21.  
  22.     write(*,*) str_array(1:80)
  23.     write(*,*) dt
  24. end program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement