25.06.2013 Views

Il Linguaggio Fortran 90/95

Il Linguaggio Fortran 90/95

Il Linguaggio Fortran 90/95

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

430 Operazioni di I/O su file<br />

! dell’alfabeto di 26 lettere. Ad esempio, se k = 2:<br />

! * c = ’A’: viene restituito ’C’<br />

! * c = ’Z’: viene restituito ’B’<br />

! - se c e’ non un carattere alfabetico maiuscolo, viene restituito<br />

! c non modificato<br />

CONTAINS<br />

FUNCTION traduci(c,k)<br />

! *** Sezione Dichiarativa<br />

IMPLICIT NONE<br />

! ** Dichiarazione argomenti fittizi<br />

CHARACTER(1), INTENT(IN) :: c<br />

INTEGER, INTENT(IN) :: k<br />

! ** DICHIARAZIONE TIPO FUNZIONE<br />

CHARACTER(1) :: traduci<br />

! *** Sezione Esecutiva<br />

IF (c’Z’) THEN<br />

traduci = c<br />

ELSE IF (IACHAR(c)+k

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!