#include <stdio.h>
int main(void)
{
int i, f, t;
char *stations[] = {"東京", "新横浜", "名古屋", "京都", "新大阪"};
char *msg[] = {"終了", "繰り返し"};
int a[][4] = {{14920, 14390, 11540, 3180},
{14600, 13660, 10910},
{6840, 6100},
{3240}
};
while (1) {
for ( i = 0; i < 5; ++i)
printf("%d:%s\n", i
+ 1, stations
[i
]); if (f > t) {
i = f;
f = t;
t = i;
}
printf("%d\n", a
[f
- 1][5 - t
]); for ( i = 0; i < 2; ++i)
printf("%d:%s\n", i
, msg
[i
]); if (i == 0)break;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKQp7CiAgaW50IGksIGYsIHQ7CiAgY2hhciAqc3RhdGlvbnNbXSA9IHsi5p2x5LqsIiwgIuaWsOaoqua1nCIsICLlkI3lj6TlsYsiLCAi5Lqs6YO9IiwgIuaWsOWkp+mYqiJ9OwogIGNoYXIgKm1zZ1tdID0geyLntYLkuoYiLCAi57mw44KK6L+U44GXIn07CgoKICBpbnQgYVtdWzRdID0ge3sxNDkyMCwgMTQzOTAsIDExNTQwLCAgMzE4MH0sCiAgICB7MTQ2MDAsIDEzNjYwLCAxMDkxMH0sCiAgICB7Njg0MCwgNjEwMH0sCiAgICB7MzI0MH0KICB9OwoKCiAgd2hpbGUgKDEpIHsKICAgIGZvciAoIGkgPSAwOyBpIDwgNTsgKytpKQogICAgICBwcmludGYoIiVkOiVzXG4iLCBpICsgMSwgc3RhdGlvbnNbaV0pOwogICAgcHJpbnRmKCJmcm9tIHRvID0gIik7CiAgICBzY2FuZigiJWQgJWQiLCAmZiwgJnQpOwogICAgaWYgKGYgPiB0KSB7CiAgICAgIGkgPSBmOwogICAgICBmID0gdDsKICAgICAgdCA9IGk7CiAgICB9CgogICAgcHJpbnRmKCIlZFxuIiwgYVtmIC0gMV1bNSAtIHRdKTsKICAgIGZvciAoIGkgPSAwOyBpIDwgMjsgKytpKQogICAgICBwcmludGYoIiVkOiVzXG4iLCBpICwgbXNnW2ldKTsKICAgIHNjYW5mKCIlZCIsICZpKTsKICAgIGlmIChpID09IDApYnJlYWs7CiAgfQoKICByZXR1cm4gMDsKfQo=