Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int idade, nPessoas, cont, idadeT;
- float peso, mediaidad;
- nPessoas = 0;
- cont = 0;
- idadeT = 0;
- while (nPessoas < 4)
- {
- nPessoas = nPessoas + 1;
- scanf("%i", &idade);
- scanf("%f", &peso);
- if ( (peso >= 0) && (idade >= 0) )
- {
- idadeT = idadeT + idade;
- if (peso > 90)
- {
- cont = cont + 1;
- }
- }
- }
- mediaidad = idadeT / (float) nPessoas;
- printf("Qtd pessoas > 90 Kg: %i\n", cont);
- printf("Idade média: %.2f\n", mediaidad);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement