02.05.2014 Views

Patrick Corde & Anne Fouilloux

Patrick Corde & Anne Fouilloux

Patrick Corde & Anne Fouilloux

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Corrigés 240<br />

Corrigé de l’exercice 9<br />

1 program sequentiel_indexe<br />

2 implicit none<br />

3 character(len=19), dimension(2), parameter :: f_index = &<br />

4 (/ "index_naissance.dat", "index_deces.dat " /)<br />

5 character(len=80) :: mus<br />

6 integer :: numrec, ios_index<br />

7 integer :: date_saisie, date_lue<br />

8 integer :: critere<br />

9 logical :: trouve<br />

10<br />

11 ! Ouverture du fichier des musiciens à accès direct en lecture<br />

12 ! et des fichiers d’index.<br />

13 open ( unit=1, file = f_index(1), &<br />

14 status="old", form="formatted", action="read" )<br />

15 open ( unit=2, file = trim(f_index(2)), &<br />

16 status="old", form="formatted", action="read" )<br />

17 open ( unit=3, file="musiciens.bin", &<br />

18 status="old", form="unformatted", &<br />

19 access="direct", action="read", recl=80 )<br />

20 do<br />

21 print*,’--------------------------------’<br />

22 print*,’Choix du critère de recherche : ’<br />

23 print*,’- par date de naissance (1)’<br />

24 print*,’- par date de décès (2)’<br />

25 print*,’- QUITTER (3)’<br />

26 read*, critere<br />

27 print*,’--------------------------------’<br />

28<br />

29 trouve = .false.<br />

INSTITUT DU DÉVELOPPEMENT<br />

ET DES RESSOURCES<br />

EN INFORMATIQUE SCIENTIFIQUE<br />

Cours langage Fortran – 27 janvier 2006<br />

<strong>Patrick</strong> <strong>Corde</strong> et <strong>Anne</strong> <strong>Fouilloux</strong>

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

Saved successfully!

Ooh no, something went wrong!