This repository has been archived on 2024-01-25. You can view files and clone it, but cannot push or open issues or pull requests.
Labo-S1/src/series/C06S04_fonctions/C05EX01.java
Rémi Heredero 4b812f019a master
2021-11-19 08:07:14 +01:00

41 lines
791 B
Java

package series.C06S04_fonctions;
import hevs.utils.Input;
public class C05EX01 {
// a
public static float cube(float x) {
return x*x*x;
}
// b
public static double puissance(int base, int exposant) {
double resultat = 1.0;
for (int i = 0; i < exposant; i++) {
resultat *= base;
}
return resultat;
}
// c
public static void f1() {
}
// d
public static int NbrLettre(String s) {
return 0;
}
// e
public static boolean f2(int x1, int x2, String s) {
return false;
}
public static void main(String[] args) {
int base = Input.readInt();
int exposant = Input.readInt();
System.out.println(puissance(base, exposant));
}
}