//使用C++文件,提交要用C++ #include#include#define N 500 struct S { char sid[N]; double score; }; int main(void) { int n, k; scanf("%d%d", &n, &k); S* s = (S*)malloc(sizeof(S) * (n + 1)); for (int i = 1; i = 1) { if (t > s[end].score) { s[end + 1] = s[end]; end--; } else break; } s[end + 1] = stu; } printf("%s %g", s[k].sid, s[k].score); free(s); return 0; }
0.0分
0 人评分