Introduction à l'algorithmique

Zwifi
1,547 views

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

Bloc Si-Alors-Sinon

1
6
7
8
9
10
11
12
// {...}
Integer a = 5;
if(a>3){
System.out.println("Titi");
}
//{...}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
6
7
8
9
10
11
12
13
14
15
// {...}
Integer a = 5;
Integer b = 3;
if(a==b){
System.out.println("Titi");
} else {
System.out.println("Toto");
}
//{...}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
6
7
8
9
10
11
12
13
14
15
16
17
18
// {...}
Boolean ilPleut= false;
Boolean ilFaitFroid = false;
if(ilPleut){
System.out.println("Où est mon imper ?");
} else if (ilFaitFroid){
System.out.println("Un gros pull, un thé chaud et ça repart !");
} else {
System.out.println("J'ai mis une chemise à manche courtes, parce qu'il fait doux.");
}
//{...}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content