알고리즘 질문이 있어요!!
#define _CRT_SECURE_NO_WARNINGS
#include
typedef struct member {
int id;
char name[20];
float score;
} example;
int over40(example* a, int n);
example find_max(example* a, int n);
void main() {
example onep, exmember[20];
int i, n;
printf("Input the number of data : ");
scanf("&d", &n);
for (i = 0; i < n; i++)
{
printf("학번_이름_점수 : ");
scanf("%d %s %f", &exmember[i].id, &exmember[i].name, &exmember[i].score);
}
printf("40점이 넘는 학생은 %d명입니다.\n", over40(exmember, n));
onep = find_max(exmember, n);
printf("Highest score student : %d %s %.2f\n", onep.id, onep.name, onep.score);
}
int over40(example* a, int n)
{
int b = 0, i;
for (i = 0; i < n; i++) {
if (a[i].score > 40)
b = b + 1;
}
return b;
};
example find_max(example* a, int n) {
};
가장 높은 점수에 해당하는 학생의 정보를 가져오도록 하는 example find_max 함수 안을 뭐라고 써야할지 모르겠어요... 혹시 알려주실 수 있나요??
SQL로 짜드렸습니다
SQL로 짜드렸습니다
SELECT * FROM a ORDER BY score DESC LIMIT 1
혹시 sql말고 c언어로 알려주실 수 있나요??
혹시 sql말고 c언어로 알려주실 수 있나요??
SQL to C compiler
SQL to C compiler
https://dl.acm.org/citation.cfm?id=2784760
...
...어허 이분이 농담이 심하시네... =_=
댓글 달기