Turbo-C
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
터보-C 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
Lua 게시판
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C/C++ Q/A
[1664] 석차(등수)부분 좀 도와주세요...
도와주세요 [] 1370 읽음    2002-11-29 21:45
성적관리프로그램에서요....
석차를 구하려하는데...
어찌해야할지...
잘 안나오네요.....
초보라서요....
도와주세요~~~~



#include<iostream.h>

class student{
   public:
      char name[50];
      int kor,eng,math,total,ave;
 
};

int chong;
void soo(student *temp);
void ib(student *temp);
void gae(student *temp);
void chul(student *temp);

void main()
{
    student temp[5];
   
   
    soo(temp);
    ib(temp);
    gae(temp);
    chul(temp);
   
}



void soo(student *temp)
{
   cout<<"\t\t성적처리 프로그램입니다...^^\n"<<endl;
   cout<<"\t총 학생수를 입력하세요..."<<endl;
   cin>>chong;
}


void ib(student *temp)
{

for(int i=0; i<chong; i++){
  cout<<"\n\t이름을 입력하시오 :  " ;
  cin>> temp[i].name;
  cout<<"\n\t국어점수 입력 :  " ;
  cin>> temp[i].kor;
  cout<<"\n\t영어점수 입력 :  " ;
  cin>> temp[i].eng;
  cout<<"\n\t수학점수 입력 :  " ;
  cin>> temp[i].math;
}
}


void gae(student *temp)
{

for( int i=0; i<chong; i++)
{
  temp[i].total = temp[i].kor + temp[i].eng + temp[i].math;

  temp[i].ave = temp[i].total / 3;
}

}


void chul(student *temp)  //prn()함수를 구현한내용
{
cout<< "\n\n\t총인원수는 : "<<chong<<"명 입니다"<<endl;

cout << "\n이름\t국어\t영어\t수학\t총점\t평균\t석차\n";
cout << "----------------------------------------------------------------\n";

for( int i=0; i<chong; i++)
{
cout << temp[i].name <<"\t";
cout << temp[i].kor <<"\t";
cout << temp[i].eng <<"\t";
cout << temp[i].math <<"\t";
cout << temp[i].total <<"\t";
cout << temp[i].ave << "\n";
}
cout << "----------------------------------------------------------------\n";
}



/*
void rank(  )
{

}
*/

+ -

관련 글 리스트
1664 석차(등수)부분 좀 도와주세요... 도와주세요 1370 2002/11/29
1665     Re:석차(등수)부분 좀 도와주세요... 조준회 1384 2002/11/30
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.