Révision 481
Ajouté par Orlani RIVERA il y a presque 3 ans
main.c | ||
---|---|---|
return ok;
|
||
}
|
||
|
||
void decode_nombre(char *ch, int n)
|
||
int decode_nombre(char *ch, int n)
|
||
{
|
||
int i, s=0;
|
||
for(i=0; i<n;i++)
|
||
{
|
||
s=s + decode_int(ch[i])*pow(10,n-1-i);
|
||
s= (s*10) + decode_int(ch[i]);
|
||
}
|
||
return s;
|
||
}
|
||
... | ... | |
printf("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}
|
||
/* Test decode */
|
||
/* Test decode_int */
|
||
/*
|
||
if (decode_int('5')!=5){
|
||
printf("Erreur Test unitaire decode_int.\n");
|
||
... | ... | |
printf("Erreur Test unitaire decode_int.\n");
|
||
exit(-1);
|
||
}
|
||
*/
|
||
/* Test decode_nombre */
|
||
/*
|
||
if (decode_nombre(7541,2) != 75){
|
||
printf("Erreur Test unitaire decode_nombre.\n");
|
||
exit(-1);
|
||
}
|
||
if (decode_nombre(987654321,2) != 98){
|
||
printf("Erreur Test unitaire decode_nombre.\n");
|
||
exit(-1);
|
||
}
|
||
*/
|
||
|
||
// Ne pas modifier cette fonction
|
Formats disponibles : Unified diff
correction de la question 7 du TP1.