목차
없음
본문내용
(void);
main()
{
int i;
input();
sort();
printf("sorting 결과입니다.\n");
for(i = 0; i<10; i++)
printf("No. %d : %5.2f\n", score[i].num, score[i].ave);
}
void input()
{
int i;
printf(" ++++ 학생 10명의 번호 국어점수 영어점수 수학점수 순으로 입력하시오 ++++\n");
for(i=0; i<10;i++){
scanf("%d%d%d%d", &score[i].num, &score[i].kor, &score[i].eng, &score[i].math);
score[i].ave = (float) (score[i].kor + score[i].eng + score[i].math) /3;
}
}
void sort()
{
struct sco tmp;
int i, j;
for(i=0; i<10; i++)
for(j=i; j<10; j++)
if(score[i].ave < score[j]. ave){
tmp=score[i];
score[i] = score[j];
score[j]=tmp;
}
}
★ 아래는 컴파일 후 결과물입니다.
main()
{
int i;
input();
sort();
printf("sorting 결과입니다.\n");
for(i = 0; i<10; i++)
printf("No. %d : %5.2f\n", score[i].num, score[i].ave);
}
void input()
{
int i;
printf(" ++++ 학생 10명의 번호 국어점수 영어점수 수학점수 순으로 입력하시오 ++++\n");
for(i=0; i<10;i++){
scanf("%d%d%d%d", &score[i].num, &score[i].kor, &score[i].eng, &score[i].math);
score[i].ave = (float) (score[i].kor + score[i].eng + score[i].math) /3;
}
}
void sort()
{
struct sco tmp;
int i, j;
for(i=0; i<10; i++)
for(j=i; j<10; j++)
if(score[i].ave < score[j]. ave){
tmp=score[i];
score[i] = score[j];
score[j]=tmp;
}
}
★ 아래는 컴파일 후 결과물입니다.
추천자료
신호와 시스템 (그래프 그리기- C언어를 이용한 맥놀이 현상의 해석)
c로배우는알고리즘에서 ROBOT프로그램을 C언어로 바꾸자.
Binomial random variable X의 distribution C언어 구현
6족 로봇 보행 발표(c언어)
[언어의이해C]인간언어의 특징을 동물의 언어와 비교해서 제시하고, 소쉬르 언어학의 주요 내...
전화번호 관리 프로젝트 단순연결리스트를 이용한 c언어 자료구조
2013 장애인 기능경기 대회 1과제 C언어 답안 (프랜차이즈 커피전문점에서 상품별 판매실적 ...
MAZE 확장[자료구조/자료구조및실험/c언어/c#/ Maze problem/Maze/Maze problem/미로/미로찾기]
소개글