#include <stdio.h>
#define TAM 7
int main() {
int i, acimaMedia = 0;
float vet[TAM], media, soma = 0;
//faz a leitura dos valores para o vetor
for (i = 0; i < TAM; i++) {
}
//mostrar valores do vetor
for (i = 0; i < TAM; i++) {
}
//determina a media
for (i = 0; i < TAM; i++) {
soma = soma + vet[i];
}
media = soma / TAM;
//determina quantos valores estao acima da media
for (i = 0; i < TAM; i++) {
if (vet[i] > media) {
acimaMedia++;
}
}
printf("\nAcima da media: %i", acimaMedia
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgojZGVmaW5lIFRBTSA3CgppbnQgbWFpbigpIHsKICAgIGludCBpLCBhY2ltYU1lZGlhID0gMDsKICAgIGZsb2F0IHZldFtUQU1dLCBtZWRpYSwgc29tYSA9IDA7CgogICAgLy9mYXogYSBsZWl0dXJhIGRvcyB2YWxvcmVzIHBhcmEgbyB2ZXRvcgogICAgZm9yIChpID0gMDsgaSA8IFRBTTsgaSsrKSB7CiAgICAgICAgc2NhbmYoIiVmIiwgJnZldFtpXSk7CiAgICAgICAgCiAgICB9CiAgICAKICAgIC8vbW9zdHJhciB2YWxvcmVzIGRvIHZldG9yCiAgICBwcmludGYoIlZldG9yOiAiKTsKICAgIGZvciAoaSA9IDA7IGkgPCBUQU07IGkrKykgewogICAgICAgIHByaW50ZigiJWYgIiwgdmV0W2ldKTsKICAgIH0KCiAgICAvL2RldGVybWluYSBhIG1lZGlhCiAgICBmb3IgKGkgPSAwOyBpIDwgVEFNOyBpKyspIHsKICAgICAgICBzb21hID0gc29tYSArIHZldFtpXTsKICAgIH0KICAgIG1lZGlhID0gc29tYSAvIFRBTTsKCiAgICAvL2RldGVybWluYSBxdWFudG9zIHZhbG9yZXMgZXN0YW8gYWNpbWEgZGEgbWVkaWEKICAgIGZvciAoaSA9IDA7IGkgPCBUQU07IGkrKykgewogICAgICAgIGlmICh2ZXRbaV0gPiBtZWRpYSkgewogICAgICAgICAgICBhY2ltYU1lZGlhKys7CiAgICAgICAgfQogICAgfQoKICAgIHByaW50ZigiXG5NZWRpYTogJWYiLCBtZWRpYSk7CiAgICBwcmludGYoIlxuQWNpbWEgZGEgbWVkaWE6ICVpIiwgYWNpbWFNZWRpYSk7CgogICAgcmV0dXJuIDA7Cn0=