forked from menault/2026_TD3_DEV51_Qualite_Algo
fonction 10 : O(L)
This commit is contained in:
@@ -235,10 +235,16 @@ int categorie(const Transaction *t)
|
||||
/* F10 : ajoute une ligne à la fin du rapport */
|
||||
int longueur(const char *s)
|
||||
{
|
||||
int n = 0;
|
||||
while (s[n] != '\0')
|
||||
n++;
|
||||
return n;
|
||||
static const char *chaine_connue = NULL;
|
||||
static int n_connu = 0;
|
||||
|
||||
if (s != chaine_connue || s[0] == '\0') {
|
||||
chaine_connue = s;
|
||||
n_connu = 0;
|
||||
}
|
||||
while (s[n_connu] != '\0')
|
||||
n_connu++;
|
||||
return n_connu;
|
||||
}
|
||||
|
||||
void ajouter_ligne(char *rapport, const char *ligne)
|
||||
|
||||
Reference in New Issue
Block a user