• <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年6月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            293012345

            潛心看書研究!

            常用鏈接

            留言簿(19)

            隨筆分類(81)

            文章分類(89)

            相冊

            ACM OJ

            My friends

            搜索

            •  

            積分與排名

            • 積分 - 217778
            • 排名 - 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 豪 閱讀(2532) | 評論 (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 豪 閱讀(1286) | 評論 (2)編輯 收藏
            年初八,我回來了.

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

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

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

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



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

            終于也體會到

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

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

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

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

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

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


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

            posted @ 2006-01-21 00:03 豪 閱讀(340) | 評論 (0)編輯 收藏
            僅列出標題
            共18頁: First 10 11 12 13 14 15 16 17 18 
            久久青青草原亚洲av无码app| 好属妞这里只有精品久久| 久久精品国产亚洲av水果派| 欧美黑人又粗又大久久久| 日本免费久久久久久久网站| 热久久国产欧美一区二区精品| 一本大道久久香蕉成人网| 久久亚洲精品无码AV红樱桃| 久久99精品国产99久久6男男| 久久久久久青草大香综合精品| 久久w5ww成w人免费| 99久久精品免费| 伊人久久久AV老熟妇色| 国产一区二区精品久久岳| 久久人人爽人人爽人人AV | 狠狠色丁香婷婷综合久久来来去| 欧美亚洲日本久久精品| 国产精品久久久久久影院| 国产精品久久久香蕉| 99久久精品免费国产大片| 久久香蕉国产线看观看精品yw| 中文精品久久久久国产网址| 奇米影视7777久久精品| 一本色综合久久| 久久精品无码一区二区app| 韩国无遮挡三级久久| 久久久久成人精品无码中文字幕| 伊人久久大香线蕉综合网站| 国产亚洲精久久久久久无码AV| 国产精品久久久久久久久鸭| 色综合久久久久无码专区| 久久精品人成免费| 伊人久久大香线蕉亚洲| 欧美日韩精品久久久免费观看| 久久不见久久见免费影院www日本| 91久久婷婷国产综合精品青草| 亚洲色欲久久久综合网| 色综合久久中文字幕无码| 久久精品亚洲精品国产色婷| 色综合久久久久久久久五月| 久久人爽人人爽人人片AV|