Compare commits

..

2 Commits

Author SHA1 Message Date
2c5ec0e958 Tables multiplication 2019-05-30 18:33:27 +02:00
53b21a837a Exo somme 2019-05-30 17:35:18 +02:00
2 changed files with 42 additions and 0 deletions

22
Somme.java Normal file
View File

@ -0,0 +1,22 @@
import static utils.Utils.*;
public class Somme { // FIXME A CHANGER
public static final void main(String[] args) {
int n=3;
afficher("Somme", n, somme(n));
}
public static int somme(int n){
int result = 0;
for(int i = 0; i <= n; i++){
result = i+result;
}
return result;
}
}

20
TableMult.java Normal file
View File

@ -0,0 +1,20 @@
import static utils.Utils.*;
public class TableMult {
public static final void main(String[] args) {
afficher("Tables de multiplication");
for(int table = 1; table <= 9; table++){
for(int mult = 1; mult <= 9; mult++){
afficher(table, "x", mult, "=", table*mult);
}
}
}
}