#include <stdio.h>
int main( ) {
int idade = 0 , cont50 = 0 , espantalho = 0 ;
float peso = 0.0 , altura = 0.0 , md = 0.0 , mdpeso = 0.0 ;
for ( int i = 1 ; i < 3 ; i++ ) {
printf ( "\n Digite a sua idade :" ) ; printf ( "Digite a sua altura :" ) ; if ( idade > 50 )
cont50++;
if ( idade >= 10 && idade <= 20 )
md += altura / 2 ;
if ( peso < 40 )
espantalho++;
mdpeso = ( espantalho / 2.0 ) * 100 ;
}
printf ( "\n O total de pessoas com idade superior a 50 e %d" , cont50
) ; printf ( "\n A media das alturas de pessoas com idade entre 10 e 20 anos e %.1f" , md
) ; printf ( "\n A porcentagem de pessoas com peso inferior a 40 kg e %f porcento" , mdpeso
) ; return 0 ;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKICAgIGludCBpZGFkZSA9IDAsIGNvbnQ1MCA9IDAsIGVzcGFudGFsaG8gPSAwOwogICAgZmxvYXQgcGVzbyA9IDAuMCwgYWx0dXJhID0gMC4wLCBtZCA9IDAuMCwgbWRwZXNvID0gMC4wOwogICAgZm9yIChpbnQgaSA9IDE7IGkgPCAzOyBpKyspIHsKICAgICAgICBwcmludGYoIlxuRGlnaXRlIGEgc3VhIGlkYWRlIDoiKTsKICAgICAgICBzY2FuZigiJWQiLCAmaWRhZGUpOwogICAgICAgIHByaW50ZigiRGlnaXRlIGEgc3VhIGFsdHVyYSA6Iik7CiAgICAgICAgc2NhbmYoIiVmIiwgJmFsdHVyYSk7CiAgICAgICAgcHJpbnRmKCJEaWdpdGUgc2V1IHBlc28gOiIpOwogICAgICAgIHNjYW5mKCIlZiIsICZwZXNvKTsKICAgICAgICBpZiAoaWRhZGUgPiA1MCkKICAgICAgICAgICAgY29udDUwKys7CiAgICAgICAgaWYgKGlkYWRlID49IDEwICYmIGlkYWRlIDw9IDIwKQogICAgICAgICAgICBtZCArPSBhbHR1cmEgLyAyOwogICAgICAgIGlmIChwZXNvIDwgNDApCiAgICAgICAgICA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