#include <stdio.h>
int main(void)
{
int i,j,k,tmp;
int a[7];
puts("7人の点数を表示してください");
for (i = 0; i < 7; i++)
scanf("%d", &a[i]);
printf("整列前:");
for (i = 0; i < 7; i++)
printf("%-5d",a[i]);
printf("\n");
for (i = 1; i < 7; i++) {
tmp = a[i];
for (k = i; k > 0 && a[k - 1] > tmp; k--)
a[k] = a[k - 1];
a[k] = tmp;
printf("%-2d回目:",i);
for (j = 0; j < 7; j++)
printf("%-5d", a[j]);
printf("\n");
}
printf("整列後:");
for (i = 0; i < 7; i++)
printf("%-5d",a[i]);
printf("\n");
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKQp7CiAgICBpbnQgaSxqLGssdG1wOwoJaW50IGFbN107CgoJcHV0cygiN+S6uuOBrueCueaVsOOCkuihqOekuuOBl+OBpuOBj+OBoOOBleOBhCIpOwoKCWZvciAoaSA9IDA7IGkgPCA3OyBpKyspCgkJc2NhbmYoIiVkIiwgJmFbaV0pOwoKCXByaW50Zigi5pW05YiX5YmN77yaIik7Cglmb3IgKGkgPSAwOyBpIDwgNzsgaSsrKQoJCXByaW50ZigiJS01ZCIsYVtpXSk7CglwcmludGYoIlxuIik7CgoJZm9yIChpID0gMTsgaSA8IDc7IGkrKykgewoJCXRtcCA9IGFbaV07CgoJCWZvciAoayA9IGk7IGsgPiAwICYmIGFbayAtIDFdID4gdG1wOyBrLS0pCgkJCWFba10gPSBhW2sgLSAxXTsKCQlhW2tdID0gdG1wOwoKCQlwcmludGYoIiUtMmTlm57nm67vvJoiLGkpOwoJCWZvciAoaiA9IDA7IGogPCA3OyBqKyspCgkJCXByaW50ZigiJS01ZCIsIGFbal0pOwoJCXByaW50ZigiXG4iKTsKCX0KCglwcmludGYoIuaVtOWIl+W+jO+8miIpOwoJZm9yIChpID0gMDsgaSA8IDc7IGkrKykKCQlwcmludGYoIiUtNWQiLGFbaV0pOwoJcHJpbnRmKCJcbiIpOwoKCXJldHVybiAwOwp9Cg==