chap10/sample7.f90

サンプルコードのダウンロード

 1#ifdef _DEBUG
 2#define DEBUG_PRINT(a) write(*,*) (a)
 3#else
 4#define DEBUG_PRINT(a)
 5#endif
 6
 7program sample
 8  implicit none
 9
10  integer :: i
11
12#if 1
13  write(*, *) 'hello A'
14#else
15  write(*, *) 'hello B'
16#endif
17
18  i = 2015
19  DEBUG_PRINT('This will be shown only when _DEBUG is defined.')
20  DEBUG_PRINT(i)
21
22  stop
23endprogram sample