forked from menault/2026_TD3_DEV51_Qualite_Algo
F4
This commit is contained in:
@@ -116,11 +116,13 @@ void total_par_client(const Transaction *t, int n, long *totaux)
|
|||||||
/* F4 : solde total de chaque jour */
|
/* F4 : solde total de chaque jour */
|
||||||
void total_par_jour(const Transaction *t, int n, long *totaux)
|
void total_par_jour(const Transaction *t, int n, long *totaux)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < NB_JOURS; j++) {
|
for (int j = 0; j < NB_JOURS; j++)
|
||||||
totaux[j] = 0;
|
totaux[j] = 0;
|
||||||
for (int i = 0; i < n; i++)
|
|
||||||
if (t[i].jour == j)
|
for (int i = 0; i < n; i++) {
|
||||||
totaux[j] += t[i].montant;
|
int jour = t[i].jour;
|
||||||
|
if (jour >= 0 && jour < NB_JOURS)
|
||||||
|
totaux[jour] += t[i].montant;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user