WA死,标程提交竟然也是错的,坑爹,总的来说是道水题,看代码就懂了
#include<stdio.h>
#include<math.h>
static int floppy(int s)
{
s = (s + 1) / 2;
s += (s + 1) / 2;
int line = s % 62 ? s / 62 + 1 : s / 62;
return line % 30000 ? line / 30000 + 1 : line / 30000;
}
int main()
{
int d, cs = 0;
while (scanf("%d", &d), d)
{
printf("File #%d\n", ++cs);
printf("John needs %d floppies.\n\n", floppy(d));
}
return 0;
}