implicit none integer(8) i character(20) moji read(*,*) moji do i=1,len(moji) if (moji(i:i) >= 'a' .and. moji(i:i) <= 'z') then moji(i:i) = char(ichar(moji(i:i)) - 32) else if (moji(i:i) >= 'A' .and. moji(i:i) <= 'Z') then moji(i:i) = char(ichar(moji(i:i)) + 32) end if end do write(*,*) moji end