• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆 - 87  文章 - 279  trackbacks - 0
            <2025年5月>
            27282930123
            45678910
            11121314151617
            18192021222324
            25262728293031
            1234567

            潛心看書研究!

            常用鏈接

            留言簿(19)

            隨筆分類(81)

            文章分類(89)

            相冊

            ACM OJ

            My friends

            搜索

            •  

            積分與排名

            • 積分 - 216468
            • 排名 - 117

            最新評論

            閱讀排行榜

            評論排行榜

            原題:

            Calculate a + b
             
            Input
            
            The input will consist of a series of pairs of integers a and b,
            separated by a space, one pair of integers per line. 
            
            Output
            
            For each pair of input integers a and b you should output the sum
             of a and b in one line,and with one line of utput for each line in input.
            
            Sample Input
            1 5
            
            Sample Output
            6
            
            Hint
            Use + operator
            

            #include<iostream>
            #include
            <string>
            using namespace std;


            int main()
            {
                
            string a,b;
                
            char *= NULL;
                
            long a_len = 0,b_len = 0,c_len=0,min_len;
                
            int one_bit = 0;
                
            bool flag = false;
                
            while(cin>>a>>b)
                
            {
                    
            if (a[0]!='-'&&b[0]!='-')
                    
            {
                        a_len 
            = a.length();
                        b_len 
            = b.length();
                        c_len 
            = (a_len>b_len?a_len:b_len)+1;
                        min_len 
            = a_len<b_len?a_len:b_len;
                        c 
            = new char[c_len+1];
                        c[c_len] 
            = '\0';
                        c[
            0= 'A';
                        
            while(min_len>0)
                        
            {
                            one_bit
            =int(a[a_len-1])+int(b[b_len-1])-96;
                            
            if(flag)
                                one_bit
            ++;
                            
            if(one_bit>9)
                            
            {
                                one_bit 
            -= 10;
                                flag 
            = true;
                            }

                            
            else
                                flag 
            = false;
                            c[c_len
            -1= char(one_bit+48);
                            one_bit 
            = 0;
                            c_len
            --;
                            min_len
            --;
                            a_len
            --;
                            b_len
            --;
                        }

                        
            if(a_len==0)
                        
            {
                            
            while(b_len>0)
                            
            {
                                one_bit
            =int(b[b_len-1])-48;
                                
            if(flag)
                                    one_bit
            ++;
                                
            if(one_bit>9)
                                
            {
                                    one_bit 
            -= 10;
                                    flag 
            = true;
                                }

                                
            else
                                    flag 
            = false;
                                c[c_len
            -1= char(one_bit+48);
                                one_bit 
            = 0;
                                c_len
            --;
                                b_len
            --;
                            }

                        }


                        
            if(b_len==0)
                        
            {
                            
            while(a_len>0)
                            
            {
                                one_bit
            =int(a[a_len-1])-48;
                                
            if(flag)
                                    one_bit
            ++;
                                
            if(one_bit>9)
                                
            {
                                    one_bit 
            -= 10;
                                    flag 
            = true;
                                }

                                
            else
                                    flag 
            = false;
                                c[c_len
            -1= char(one_bit+48);
                                one_bit 
            = 0;
                                c_len
            --;
                                a_len
            --;
                            }

                        }

                        
                        
            if(flag)
                            c[
            0= '1';
                    }


                    
            if (flag)
                        cout
            <<c<<endl;
                    
            else
                        cout
            <<++c<<endl;
                    flag 
            = false;
                    c 
            = NULL;
                }

                

                
            return 0;
            }

            這是當時提交的源程序,本以為要考慮負數的,原來不用......
            posted @ 2006-02-08 02:15 豪 閱讀(2527) | 評論 (27)編輯 收藏
            同濟大學的 Online Judge -http://acm.tongji.edu.cn/
            浙江大學的 Online Judge -http://acm.zju.edu.cn/
            北京大學的 Online Judge -http://acm.pku.edu.cn/
            吉林大學的 Online Judge -http://acm.jlu.edu.cn/
            四川大學的 Online Judge -http://cs.scu.edu.cn/acm
            汕頭大學的 Online Judge -http://acm.stu.edu.cn/
            中科大的 Online Judge -http://acm.ustc.edu.cn/index.php
            哈工大的 Online Judge -http://acm.hit.edu.cn/acm.php
            西班牙的 Universidad de Valladolid -http://acm.uva.es/
            俄羅斯烏拉爾大學 -http://acm.timus.ru/
            posted @ 2006-02-07 17:14 豪 閱讀(1280) | 評論 (2)編輯 收藏
            年初八,我回來了.

            記得在清遠的時候,同學朋友聽到我初八回去的時候,都是那一臉的驚訝,然后都很不由自主地問我回去做什么,然后我說項目還沒做完,然后他們都豎起拇指,說我厲害.

            我很感謝朋友們的稱贊,可是真的那么厲害嗎?也許我沒什么自信.雖然人家說,大一做項目賺錢已經很厲害啦,可是就我知道,我在做的項目,根本沒有什么深度可言,只是一些邏輯上的組合罷了.

            記得每次回去的時候,爸爸都說,要讀好書,先不要想著賺錢.爸爸說得是有道理的,放假后每天在趕項目,每天在重復相同的事情,覺得真的有點無聊,有點郁悶......但我又想,拿點經驗吧,總比看了書,不實踐好......

            人有時候就是很奇怪,經常自我矛盾,不過我想這次我是不會的了,我已經決定暫時不在做項目了,因為我深知自己的基礎差,記得xmm所過,只要努力,哪個方向都會成功的,所以決定了還是先看看書,搞下acm好了,最近發現,老是做項目,人會變得遲鈍......



            posted @ 2006-02-06 00:44 豪 閱讀(224) | 評論 (0)編輯 收藏

            終于也體會到

            連續幾天工作10多小時的滋味....

            不過也值得,沒吃過苦,是應該吃點的....

            posted @ 2006-01-23 01:21 豪 閱讀(333) | 評論 (1)編輯 收藏

            花了一天的時間,終于完成管理地區的功能.

            本以為這個功能很簡單,但做起來,很多的細節要注意,這樣堆積起來,就是時間了.

            行業管理今天是做不完的了,明天再奮斗吧.


            Ep:做功能的時候,是應該把功能想清楚再做的.

            posted @ 2006-01-21 00:03 豪 閱讀(333) | 評論 (0)編輯 收藏
            僅列出標題
            共18頁: First 10 11 12 13 14 15 16 17 18 
            欧美日韩精品久久久久| 国产精品美女久久久久AV福利| 久久SE精品一区二区| 国产精品久久久久久久app| 亚洲精品国精品久久99热一| 国内精品久久久久久99蜜桃| 日本精品久久久久中文字幕| 国产69精品久久久久观看软件| 久久电影网2021| 久久久国产99久久国产一| 99精品久久精品| 亚洲精品无码久久不卡| 久久99精品国产一区二区三区| 久久精品中文字幕第23页| 久久久久亚洲AV无码专区体验| 亚洲精品国产综合久久一线| 777米奇久久最新地址| 亚洲国产成人久久精品99 | 久久精品国产99国产精品| 2021国内久久精品| 久久精品成人免费国产片小草| 久久国产欧美日韩精品| 大香伊人久久精品一区二区| 久久久久久国产a免费观看不卡| 久久99精品久久只有精品| 久久久久人妻一区二区三区 | 久久人人爽人人爽人人片av高请| 久久se精品一区二区影院| 久久免费精品视频| 国产精品久久精品| 久久国产精品一区二区| 99999久久久久久亚洲| 久久精品国产网红主播| 久久精品国产亚洲av麻豆小说| 久久亚洲精品无码aⅴ大香| 亚洲精品综合久久| 国产精品久久久久久久久久影院 | 久久久久综合国产欧美一区二区| 久久99精品国产麻豆宅宅| 久久线看观看精品香蕉国产| 久久精品成人国产午夜|