1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| public class course2 {
public static void main (String[]args){
int nbParticipants, option, position;
System.out.println (" Entrez un nombre de participants ");
nbParticipants = Terminal.lireInt ();
char[] participants = new char[nbParticipants];
for(int i=0; i<nbParticipants; i++ ) {
System.out.println (" ajouter un participant ");
participants [i] = Terminal.lireChar ();
}
System.out.println ( " choisir une option ");
System.out.println ( " 1. afficher la liste des participants ");
System.out.println ( " 2. afficher le classement provisoire " );
System.out.println ( " 3. enregistrer une arrivée " );
System.out.println ( " 4. enregistrer un abandon ");
System.out.println (" 5. enregistrer une disqualification ");
System.out.println ( " 6. Quitter ");
option =Terminal.lireInt ();
if (option == 1){
for(int i=0; i<participants.length; i++ )
System.out.println (participants[i]);
}
if (option ==3) {
System.out.print (" Entrez le nom du participant ");
System.out.print (" Quel est sa position ?");
position = Terminal.lireInt ();
}
} |
Partager