zrq495
www.zrq495.com
摘要: 固定下面的个数,依次增加上面点的个数,公式:n*(n-1)*m*(m-1)/4 。代码: 1 #include<iostream> 2 3 using namespace std; 4 5 int main() 6 { 7 long long int n, m, c=1; 8 while(cin >> n >> m, n||m) 9 cout << "Case " << c++ << ": " << n*(n-1)*m*(m-1)/4 << endl;10 r 阅读全文
posted @ 2012-07-26 20:54 zrq495 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 球的表面积 :4*π*r*r, 分割后多出的面积 :n*π*r*r,利润 :25*n % 。当n=1时, 利润:0%。 1 #include<iostream> 2 3 using namespace std; 4 5 int main() 6 { 7 long long n; 8 while(cin >> n, n>0) 9 {10 if (n == 1) cout << "0%" << endl;11 else cout << 25*n << "%" << en 阅读全文
posted @ 2012-07-26 19:24 zrq495 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 最小步数 距离 0 01 12 23 44 65 96 12代码: 1 #include<iostream> 2 #include<cmath> 3 4 using namespace std; 5 6 int main() 7 { 8 int T, n, m; 9 int dis, step;10 cin >> T;11 while(T--)12 {13 cin >> n >> m;14 dis=m-n;15 if (dis == ... 阅读全文
posted @ 2012-07-26 17:10 zrq495 阅读(268) 评论(0) 推荐(0) 编辑
摘要: 蜗牛,白天向上爬,晚上向下滑,还有疲劳(常数)。蜗牛不能向下爬,所以蜗牛爬行的距离不能是负数。代码: 1 #include<iostream> 2 3 using namespace std; 4 5 int main() 6 { 7 int flag, day; 8 double h, u, d, p, t; 9 while(cin >> h >> u >> d >> p, h)10 {11 day=0;12 flag=0;13 t=0;14 p=p*u*1.0/100;15 ... 阅读全文
posted @ 2012-07-26 14:52 zrq495 阅读(326) 评论(0) 推荐(0) 编辑