17 lines
289 B
C
17 lines
289 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int f(int t[], int len, int x) {
|
|
int count = 0;
|
|
while (len >= 0) {
|
|
count += t[len] == x;
|
|
len--;
|
|
}
|
|
return count;
|
|
}
|
|
|
|
int main() {
|
|
int t[8] = {3, 6, 7, 6, 9, 9, 5, 9};
|
|
printf("nombre de 9 : %d\n", f(t, 8, 9));
|
|
}
|