Révision 26
Ajouté par gasacco il y a environ 4 ans
main.c | ||
---|---|---|
}
|
||
|
||
|
||
|
||
/*float ConversionSexaDec(float coord)
|
||
{
|
||
int Entiere = coord/100;
|
||
float Decimale = (float) coord - Entiere*100;
|
||
float Conversion = Entiere + Decimale/60
|
||
return Conversion;
|
||
}*/
|
||
|
||
//Fonction ? modifier !!!!!
|
||
void traitement(char * trame)
|
||
... | ... | |
printf("%s", trame);
|
||
}
|
||
cpt++;
|
||
}
|
||
|
||
int decode_nombre( char *ch, int n) //A coder sans strlen
|
||
{
|
||
int i =0;
|
||
int Somme = 0;
|
||
if (n>strlen(ch))
|
||
{
|
||
n = strlen(ch);
|
||
}
|
||
for (i;i<=n-1;i++)
|
||
{
|
||
int Entiere = decode_int(ch[i]);
|
||
Somme =Somme + Entiere*pow(10,n-1-i);
|
||
|
||
}
|
||
printf("%ld", Somme);
|
||
}
|
||
|
||
|
||
float ConversionSexaDec(char coord)
|
||
{
|
||
float Ent_Coord_Sexa = decode_nombre(coord, 4);
|
||
float Dec_Coord_Sexa;
|
||
for (int i =5;i<9;i++)
|
||
{
|
||
Dec_Coord_Sexa =Dec_Coord_Sexa*10+decode_int(coord[i]);
|
||
}
|
||
float Coord_Sexa = (float) Ent_Coord_Sexa +(float) Dec_Coord_Sexa/10000;
|
||
|
||
}
|
||
|
||
//Ajouter vos tests unitaires dans cette fonction.
|
||
void tests_unitaires(void){
|
Formats disponibles : Unified diff
Fonction decode_nombre avec strlen et début fonction Conversion