I have to create a program that reverses phrases.
For example: when I write hello guys
, I want syug olleh
This is what I have for the moment but I don't know how to reverse the characters in the board phraseT
:
program reversing
implicit none
character(len=20),dimension(1:20)::phraseT
character(len=20)::phrase,reverse
integer::i,x
write(*,*)"write a phrase :"
read(*,'(a)')phrase
x=len(trim(phrase))
nomT(1:20)=" "
do i=1,x
nomT(i:i)=trim(phrase(i:i))
end do
write(*,*)nomT
end program reversing
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…