Exo somme

This commit is contained in:
Meutel 2019-05-30 17:35:18 +02:00
parent 8af4c7fb70
commit 53b21a837a
1 changed files with 22 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;
}
}