#include <stdio.h>
int main() {
float valor[5], media, soma_positivo;
int positivo, i;
for (i = 0; i < 6; i++) {
scanf("%f", &valor[i]);
}
for (i = 0; i < 6; i++) {
if (valor[i] > 0) {
positivo++;
soma_positivo += valor[i];
}
}
media = soma_positivo / positivo;
printf("%d valores positivos\n", positivo);
printf("%.1f\n", media);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: