프로그램 내용은 사람정보 입력받고 평균키나 평균몸무게 출력하는거에여
#include
#define N 10
struct person
{
char name[7];
int id, tel, height, weight;
};
void input(struct person people[N]); // 정보입력 함수 선언
void average(struct person people[N]); // 평균산출 함수 선언
void output(struct person people[N]); // 출력 함수 선언
int main()
{
input(&person);
printf(" >> 평균키 보다 높은사람은");
output(person);
}
void input(struct person people)
{
for(int i=0; i
printf("이름, 주민번호, 전화번호, 키, 몸무게를 순서대로 입력하세요"); scanf("%s %d %d %d %d",people[i].name,people[i].id,people[i].tel,people[i].height,people[i].weight);
}
}
void average(struct person people)
{
for(int i=0;i
{
sum.height += people[i].height;
sum.weight += people[i].weight;
}
average.height = sum.height / N;
average.weight = sum.weight / N;
}
void output(struct person people)
{
for(int i=0;i
{
if(people[N].height>=average.hight)
people[N].height = a;
}
printf("%s",people[N].name);
}
네
오류 정정좀ㅋㅋㅋ
고쳤음