Académique Documents
Professionnel Documents
Culture Documents
Bloc Utiles en Python
Bloc Utiles en Python
* Fichier CenJava.java
*
* Convertir fonction1_h19.c en java
*
*/
public class CenJava
{
static int combien(char statut[], int nbPers, char statutVoulu)
{
int n = 0;
for(int i = 0; i < nbPers; i++)
if(statut[i] == statutVoulu)
n++;
return n;
}
/*
+++++++++++++++++++++++++++++++++++++++++++
+ Auteur : Charbonneau Lise Section A G1 +
+++++++++++++++++++++++++++++++++++++++++++
+ But : cette fonction calcule et retourne+
+ la moyenne d'un tableau des reels +
+ contenant nbElem elements +
+++++++++++++++++++++++++++++++++++++++++++
*/
static double moyenne(double tableau[], int nbElem)
{ double somme = 0.0;
for(int i = 0; i < nbElem; i++)
somme += tableau[i];
return somme / nbElem;
}
static void trier(double [] taille, double []poids,
char statut[], int nbPers)
{
for(int i = 0; i < nbPers-1; i++)
{
int indMin = i;
for(int j = i+1; j < nbPers; j++)
if (taille[j] < taille[indMin])
indMin = j;
if (indMin != i)
{
double tempo = taille[i];
taille[i]= taille[indMin];
taille[indMin]= tempo;
tempo = poids[i];
poids[i]= poids[indMin];
poids[indMin]= tempo;
}
}
*/
afficherMois(codePerm.substring(6,8));
}
}
/* Compilation et Excution:
--------------------Configuration: <Default>--------------------
Nom et prenom :
- tel quel :Leblanc Nicole
- en majuscules :LEBLANC NICOLE
- en minuscules :leblanc nicole
Process completed.
*/