cours-info/Somme.java

23 lines
322 B
Java

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;
}
}