Compare commits

..

2 Commits

Author SHA1 Message Date
68fa123bfe Exercice FizzBuzz 2019-06-17 17:38:16 +02:00
7843ea57c2 Exercice somme entre 2 entiers 2019-06-17 17:37:53 +02:00
2 changed files with 32 additions and 3 deletions

View File

@ -4,6 +4,22 @@ public class FizzBuzz {
public static final void main(String[] args) { public static final void main(String[] args) {
}
for (int a=1; a<=199; a++){
if (a%3==0){
if (a%5==0) {
afficher("FizzBuzz");
} else {
afficher("Fizz");
}
} else{
if (a%5==0){
afficher("Buzz");
} else{
afficher(a);
}
}
}
}
} }

View File

@ -9,7 +9,20 @@ public class Somme2 {
} }
public static final int somme2(int n, int p) { public static final int somme2(int n, int p) {
return 0;
} if (n<=p){
int r=0;
for (int q=n; q<=p; q++){
r=r+q;
}
return r;
}
else {
return somme2(p,n);
}
}
} }