#include <stdio.h>
int main() {
int scores[10];
int lucky_index = -1;
int ninth_score;
for (int i = 0; i < 10; i++) {
}
for (int i = 0; i < 9; i++) {
for (int j = i + 1; j < 10; j++) {
if (scores[i] < scores[j]) {
int temp = scores[i];
scores[i] = scores[j];
scores[j] = temp;
}
}
}
ninth_score = scores[8];
int count = 0;
for (int i = 0; i < 10; i++) {
if (scores[i] == ninth_score) {
count++;
if (lucky_index == -1) {
lucky_index = i + 1;
}
}
}
printf("9位の点数:%d\n", ninth_score
); printf("ラッキーな人:%d人目\n", lucky_index
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKICAgIGludCBzY29yZXNbMTBdOyAKICAgIGludCBsdWNreV9pbmRleCA9IC0xOyAKICAgIGludCBuaW50aF9zY29yZTsgCiAgICAKICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDEwOyBpKyspIHsKICAgICAgICBzY2FuZigiJWQiLCAmc2NvcmVzW2ldKTsKICAgIH0KCiAgICBmb3IgKGludCBpID0gMDsgaSA8IDk7IGkrKykgewogICAgICAgIGZvciAoaW50IGogPSBpICsgMTsgaiA8IDEwOyBqKyspIHsKICAgICAgICAgICAgaWYgKHNjb3Jlc1tpXSA8IHNjb3Jlc1tqXSkgewogICAgICAgICAgICAgICAgaW50IHRlbXAgPSBzY29yZXNbaV07CiAgICAgICAgICAgICAgICBzY29yZXNbaV0gPSBzY29yZXNbal07CiAgICAgICAgICAgICAgICBzY29yZXNbal0gPSB0ZW1wOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKICAgIG5pbnRoX3Njb3JlID0gc2NvcmVzWzhdOwoKICAgIGludCBjb3VudCA9IDA7CiAgICBmb3IgKGludCBpID0gMDsgaSA8IDEwOyBpKyspIHsKICAgICAgICBpZiAoc2NvcmVzW2ldID09IG5pbnRoX3Njb3JlKSB7CiAgICAgICAgICAgIGNvdW50Kys7CiAgICAgICAgICAgIGlmIChsdWNreV9pbmRleCA9PSAtMSkgewogICAgICAgICAgICAgICAgbHVja3lfaW5kZXggPSBpICsgMTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KICAgIHByaW50ZigiOeS9jeOBrueCueaVsO+8miVkXG4iLCBuaW50aF9zY29yZSk7CiAgICBwcmludGYoIuODqeODg+OCreODvOOBquS6uu+8miVk5Lq655uuXG4iLCBsdWNreV9pbmRleCk7CgogICAgcmV0dXJuIDA7Cn0=