Optimiser F3 par accumulation directe des soldes clients

This commit is contained in:
rabot
2026-10-21 11:12:21 +02:00
parent 2b34b35f2b
commit 14c18a3975
3 changed files with 35 additions and 5 deletions
+3 -5
View File
@@ -130,12 +130,10 @@ int nb_clients_distincts(const Transaction *t, int n)
/* F3 : solde total de chaque client */
void total_par_client(const Transaction *t, int n, long *totaux)
{
for (int c = 0; c < NB_CLIENTS; c++) {
for (int c = 0; c < NB_CLIENTS; c++)
totaux[c] = 0;
for (int i = 0; i < n; i++)
if (t[i].client == c)
totaux[c] += t[i].montant;
}
for (int i = 0; i < n; i++)
totaux[t[i].client] += t[i].montant;
}
/* F4 : solde total de chaque jour */