• <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>

            ACM___________________________

            ______________白白の屋
            posts - 182, comments - 102, trackbacks - 0, articles - 0
            <2010年8月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            2930311234

            常用鏈接

            留言簿(24)

            隨筆分類(332)

            隨筆檔案(182)

            FRIENDS

            搜索

            積分與排名

            最新隨筆

            最新評論

            閱讀排行榜

            評論排行榜

            MiYu原創(chuàng), 轉(zhuǎn)帖請注明 : 轉(zhuǎn)載自 ______________白白の屋

            題目地址:
                     http://acm.hdu.edu.cn/showproblem.php?pid=2061
            題目描述:
            Problem Description
            background:
            new semester comes , and the HDU also meets its 50th birthday. No matter what's your major, the only thing I want to tell you is:"Treasure the college life and seize the time." Most people thought that the college life should be colorful, less presure.But in actual, the college life is also busy and rough. If you want to master the knowledge learned from the book, a great deal of leisure time should be spend on individual study and practise, especially on the latter one. I think the every one of you should take the learning attitude just as you have in senior school.
            "
            No pain, No Gain", HDU also has scholarship, who can win it? That's mainly rely on the GPA(grade-point average) of the student had got. Now, I gonna tell you the rule, and your task is to program to caculate the GPA.
            If there are K(K > 0) courses, the i-th course has the credit Ci, your score Si, then the result GPA is
            GPA 
            = (C1 * S1 + C2 * S2 +……+Ci * Si……) / (C1 + C2 + ……+ Ci……) (1 <= i <= K, Ci != 0)
            If there 
            is a 0 <= Si < 60, The GPA is always not existed.
             

            Input
            The first number N indicate that there are N test cases(N 
            <= 50). In each case, there is a number K (the total courses number), then K lines followed, each line would obey the format: Course-Name (Length <= 30) , Credits(<= 10), Score(<= 100).
            Notice: There 
            is no blank in the Course Name. All the Inputs are legal
             

            Output
            Output the GPA of each 
            case as discribed above, if the GPA is not existed, ouput:"Sorry!"else just output the GPA value which is rounded to the 2 digits after the decimal point. There is a blank line between two test cases. 
             

            Sample Input
            2
            3
            Algorithm 
            3 97
            DataStruct 
            3 90
            softwareProject 
            4 85
            2
            Database 
            4 59
            English 
            4 81
             

            Sample Output
            90.10

            Sorry
            !


            題目分析:

                     這只是一道簡單的數(shù)值計算題, 唯一的難度在讀題.  直接使用題目給出的公式就可以了, 當(dāng)然如果掛科的話,要輸出 "Sorry!"

            下面是題目的大致翻譯:
            背景:
            新的學(xué)期即將到來,也正逢杭州電子科技大學(xué)50周年校慶。無論你的專業(yè)是什么,我唯一要告訴那么的是:“珍惜大學(xué)的生活,利用好時間。” 很多人認為大學(xué)的生活回是豐富多采。但事實是,大學(xué)生活也同樣忙碌。如果你要掌握書上的知識,你的空閑時間必須花在自學(xué)和實踐上,尤其是實踐。我認為,作為一位大學(xué)生,所有人都必須端正自己的學(xué)習(xí)態(tài)度。
            “沒有不勞而獲的事情”,杭電也設(shè)立了獎學(xué)金,你能得到嗎?它主要依據(jù)是學(xué)生獲得的GPA(測評平均分)?,F(xiàn)在,我將告訴你它的規(guī)則,你的任務(wù)就是編程計算GPA。
            假如有K門課程,第i門課的學(xué)分為Ci,你的成績?yōu)闉镾i,則GPA為:
            GPA 
            = (C1 * S1 + C2 * S2 +……+Ci * Si……) / (C1 + C2 + ……+ Ci……) (1 <= i <= K, Ci != 0)
            如果有一門課程成績在0到60之間,則GPA將不存在。

            代碼如下:
            MiYu原創(chuàng), 轉(zhuǎn)帖請注明 : 轉(zhuǎn)載自 ______________白白の屋

            #include 
            <iostream>
            int main ()
            {
                
            int f, T, N;
                
            double s, c;
                
            double up, down; 
                scanf( 
            "%d"&T );
                
            while ( T -- )
                {
                        scanf ( 
            "%d"&N );
                        up 
            = down = f = 0;
                        
            while ( N -- )
                        {
                              scanf ( 
            "%*s%lf%lf"&c, &s );
                              
            if ( f )
                              {
                                   
            continue;
                              }
                              
            if ( s < 60 && s >= 0 )
                              {
                                   f 
            = 1;
                              }
                              up 
            += s * c;
                              down 
            += c;
                        }
                        printf( f 
            ? "Sorry!\n" : "%.2f\n", up / down );
                        
            if ( T ) putchar ( '\n' );
                }
                
            return 0;
            }

            Feedback

            # re: HDOJ HDU 2061 Treasure the new start, freshmen! ACM 2061 IN HDU   回復(fù)  更多評論   

            2010-08-07 22:43 by Tanky Woo
            好吧,這題我就直接COPY你的代碼了
            一本大道加勒比久久综合| 国产午夜精品久久久久九九电影| 丁香五月综合久久激情| 久久久久夜夜夜精品国产| 久久精品国产91久久综合麻豆自制 | 波多野结衣久久一区二区| 青青青青久久精品国产h久久精品五福影院1421 | 99久久国产综合精品五月天喷水| 亚洲天堂久久精品| 久久精品国产精品亚洲下载| 久久久91人妻无码精品蜜桃HD| 亚洲精品第一综合99久久| 无码人妻久久一区二区三区免费丨 | 久久激情五月丁香伊人| 久久久久久久综合狠狠综合| 精品综合久久久久久97| 精品久久久久久亚洲精品 | 午夜精品久久久久9999高清| 日韩人妻无码一区二区三区久久99 | 午夜精品久久久久久| 色偷偷久久一区二区三区| 国产精品99久久久久久董美香 | 国产激情久久久久久熟女老人| 国产精品福利一区二区久久| 精品久久久无码中文字幕天天| 久久久久亚洲av成人网人人软件 | 日韩亚洲欧美久久久www综合网| 久久国产精品波多野结衣AV| 欧美丰满熟妇BBB久久久| 热综合一本伊人久久精品| 久久精品视频免费| 久久久久久国产精品免费无码 | 久久久久久久久久久久中文字幕| 久久久久无码中| 久久99国产亚洲高清观看首页| 亚洲精品乱码久久久久66| 日本久久久久久久久久| 久久精品国产亚洲欧美| 久久久亚洲AV波多野结衣| 亚洲精品tv久久久久久久久久| www.久久热|