Skip to content

Instantly share code, notes, and snippets.

@clara-shin
Created May 30, 2018 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clara-shin/20a70a4e534e414176468adb11ddc804 to your computer and use it in GitHub Desktop.
Save clara-shin/20a70a4e534e414176468adb11ddc804 to your computer and use it in GitHub Desktop.
성적처리C
int e[2]; //영어 성적을 위한 변수
int m[2]; //수학 성적을 위한 변수
void input_grade() { //영어, 수학 성적을 입력 받는 함수
e[0] = 90; //첫 번째 학생의 영어 성적
e[1] = 80; //두 번째 학생의 영어 성적
m[0] = 85; //첫 번째 학생의 수학 성적
m[1] = 80; //두 번째 학생의 수학 성적
}
void output_grade() { //총점 출력하는 함수
printf("%d, %d", e[0]+m[0], e[1]+m[1]);
}
void main(void) {
input_grade();
output_grade();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment