Skip to content
Snippets Groups Projects
Commit fbe47c8c authored by BobLeHibou's avatar BobLeHibou
Browse files

ADD: bacle ex4, vite

parent e0f6da96
Branches
No related tags found
No related merge requests found
......@@ -5,7 +5,21 @@
#define N 7
// PAS FAIT COMME DEMANDE PAR MANQUE DE TEMPS (fait rapidement, en dernier)
int main() {
int main() {
float tab[N];
for (int i = 0; i < N; ++i) {
scanf("%f", &(tab[i]));
}
int interv[N];
for (int i = 0; i < N; ++i) {
interv[i] = 1;
for (int t = 0; t < i; ++t) { // t < i car interv[i] initialise a 1
if (tab[t] <= tab[i]) { interv[i] += 1; }
}
}
for (int i = 0; i < N; ++i) { printf("%d\n", interv[i]); }
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment