• HDU step by step


    section 1 不解释~

    section 2

    1.2.1 a+b coming

     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
    ",z );
    11            }
    12     return 0;
    13 }
    View Code

    1.2.2 Climbing Worm

     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
    ",t);
    60     }
    61     return 0;
    62 }
    View Code

    1.2.3 finacial management

     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
    ",a/12);
    51     return 0;
    52 }
    View Code
  • 相关阅读:
    Java中的四种内部类
    用输入/输出写一个程序,让用户输入一些姓名和电话号码
    分批读取大数据问题
    Linux产生序列数字
    两个有序链表的合并
    int和Integer的区别
    wait()和sleep()的区别
    Unix和Windows文件格式转化
    截取字符串的代码实现
    查看系统信息
  • 原文地址:https://www.cnblogs.com/qscqesze/p/3933087.html
Copyright © 2020-2023  润新知