码迷,mamicode.com
首页 > 其他好文 > 详细

HDU step by step

时间:2014-08-24 19:18:32      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   os   io   for   ar   art   

section 1 不解释~

section 2

1.2.1 a+b coming

bubuko.com,布布扣
 1 #include<stdio.h>
 2 long long z,x,y;
 3 int main( )
 4 {
 5     while( scanf( "%I64x%I64x",&x,&y ) != EOF )
 6     {
 7            z = x + y;
 8            if( z < 0 )
 9                printf( "-" ), z = -z;
10            printf( "%d\n",z );
11            }
12     return 0;
13 }
View Code

1.2.2 Climbing Worm

bubuko.com,布布扣
 1 //
 2 //                       _oo0oo_
 3 //                      o8888888o
 4 //                      88" . "88
 5 //                      (| -_- |)
 6 //                      0\  =  /0
 7 //                    ___/`---‘\___
 8 //                  .‘ \\|     |// ‘.
 9 //                 / \\|||  :  |||// 10 //                / _||||| -:- |||||- 11 //               |   | \\\  -  /// |   |
12 //               | \_|  ‘‘\---/‘‘  |_/ |
13 //               \  .-\__  ‘-‘  ___/-. /
14 //             ___‘. .‘  /--.--\  `. .‘___
15 //          ."" ‘<  `.___\_<|>_/___.‘ >‘ "".
16 //         | | :  `- \`.;`\ _ /`;.`/ - ` : | |
17 //         \  \ `_.   \_ __\ /__ _/   .-` /  /
18 //     =====`-.____`.___ \_____/___.-`___.-‘=====
19 //                       `=---=‘
20 //
21 //
22 //     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 //
24 //               佛祖保佑         永无BUG
25 //
26 //
27 //
28 #include<iostream>
29 #include<string.h>
30 #include<stdio.h>
31 #include<ctype.h>
32 #include<algorithm>
33 #include<stack>
34 #include<queue>
35 #include<set>
36 #include<math.h>
37 #include<vector>
38 #include<map>
39 #include<deque>
40 #include<list>
41 using namespace std;
42 int main()
43 {
44     int a,b,c;
45     while(cin>>c>>a>>b)
46     {
47         if(a+b+c==0)
48             break;
49         int t=0;
50         while(c>0)
51         {
52             t++;
53             c-=a;
54             if(c<=0)
55                 break;
56             c+=b;
57             t++;
58         }
59         printf("%d\n",t);
60     }
61     return 0;
62 }
View Code

1.2.3 finacial management

bubuko.com,布布扣
 1 //
 2 //                       _oo0oo_
 3 //                      o8888888o
 4 //                      88" . "88
 5 //                      (| -_- |)
 6 //                      0\  =  /0
 7 //                    ___/`---‘\___
 8 //                  .‘ \\|     |// ‘.
 9 //                 / \\|||  :  |||// 10 //                / _||||| -:- |||||- 11 //               |   | \\\  -  /// |   |
12 //               | \_|  ‘‘\---/‘‘  |_/ |
13 //               \  .-\__  ‘-‘  ___/-. /
14 //             ___‘. .‘  /--.--\  `. .‘___
15 //          ."" ‘<  `.___\_<|>_/___.‘ >‘ "".
16 //         | | :  `- \`.;`\ _ /`;.`/ - ` : | |
17 //         \  \ `_.   \_ __\ /__ _/   .-` /  /
18 //     =====`-.____`.___ \_____/___.-`___.-‘=====
19 //                       `=---=‘
20 //
21 //
22 //     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 //
24 //               佛祖保佑         永无BUG
25 //
26 //
27 //
28 #include<iostream>
29 #include<string.h>
30 #include<stdio.h>
31 #include<ctype.h>
32 #include<algorithm>
33 #include<stack>
34 #include<queue>
35 #include<set>
36 #include<math.h>
37 #include<vector>
38 #include<map>
39 #include<deque>
40 #include<list>
41 using namespace std;
42 int main()
43 {
44     float a=0,b;
45     for(int i=1;i<=12;i++)
46     {
47         cin>>b;
48         a+=b;
49     }
50     printf("$%.2lf\n",a/12);
51     return 0;
52 }
View Code

 

HDU step by step

标签:style   blog   http   color   os   io   for   ar   art   

原文地址:http://www.cnblogs.com/qscqesze/p/3933087.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!