Posted on 2008-05-14 12:12
superman 阅读(258)
评论(0) 编辑 收藏 引用 所属分类:
ZOJ
1 /* Accepted 1293 C++ 00:00.00 836K */
2 #include <iostream>
3
4 using namespace std;
5
6 int main()
7 {
8 int n, cnt = 0;
9 while((cin >> n) && n)
10 {
11 n = int(n / 2.0 + 0.5);
12 n = n + int(n / 2.0 + 0.5);
13
14 if(n % 62 == 0)
15 n /= 62;
16 else
17 n = n / 62 + 1;
18
19 if(n % 30000 == 0)
20 n /= 30000;
21 else
22 n = n / 30000 + 1;
23
24 cnt++;
25 cout << "File #" << cnt << endl;
26 cout << "John needs " << n << " floppies." << endl << endl;
27 }
28
29 return 0;
30 }
31