! 学習目的:ifブロック文(その1) ! ex302.f a=4. if(a.le.1.) then write(*,*) 'a' else if(a.le.3.) then write(*,*) 'b' else if(a.le.5.) then !最初に条件を満たしたところのブロックに入る. write(*,*) 'c' !このブロックが実行されて,次に,end if以下の実行文が実行される. else if(a.le.7.) then write(*,*) 'd' else ! else文は省略可 write(*,*) 'e' end if !ifブロックの最後に必ず書く. write(*,*) 'stop' stop end