strlen.f90

来自「Mac OS X 10.4.9 for x86 Source Code gcc」· F90 代码 · 共 35 行

F90
35
字号
! Program to test the LEN and LEN_TRIM intrinsics.subroutine test (c)   character(*) c   character(len(c)) d   d = c   if (len(d) .ne. 20) call abort   if (d .ne. "Longer Test String") call abort   c = "Hello World"end subroutinesubroutine test2 (c)   character (*) c   character(len(c)) d   d = c   if (len(d) .ne. 6) call abort   if (d .ne. "Foobar") call abortend subroutineprogram strlen   implicit none   character(20) c   character(5) a, b   integer i   c = "Longer Test String"   call test (c)   if (len(c) .ne. 20) call abort   if (len_trim(c) .ne. 11) call abort   call test2 ("Foobar");end program

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?