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

            藍(lán)牙博客

            i want to be a coder~

               :: 首頁 ::  ::  :: 管理

            搜索

            •  

            最新評論

            浙大1018 Be carefull

            Be carefull
            Time Limit:1000MS  Memory Limit:32768K


            Description:
            “Be carefull about the precision!”When Tyr doing his mathemetic homework,teacher Mr.Qian always giving this warning to him.Now,Tyr has finished his mathemetic homework,and here is your task to check whether Tyr’s answer is correct or not.

            Input:
            The input consist of several cases.The first line gives the case number N, the next part has N cases.Each case is consist of two number R and I.R is a real number; I is an integer number.
            Output:
            For each case please give your check.If R rounds to I,then print “Correct” in a single line, or,print “Not Correct”.For more detail,please look at the samples.
            Sample Input:
            5
            1.20 1
            0.5 1
            9.9 10
            2.9 2
            3.4999 3Sample Output:
            Correct
            Correct
            Correct
            Not Correct
            Correct

            解答:(實(shí)質(zhì)就是一個四舍五入的題)
            #include <iostream>
            #include <string>
            using namespace std;
            int main()
            {
             int a,t,T,tmp;
             double s;
             scanf("%d",&T);
             while(T--)
             {
              scanf("%lf%d",&s,&a);
              s=s*10;
              tmp=s;
              t=tmp%10;
              tmp/=10;
              if(t>4) tmp+=1;
              if(tmp==a) printf("Correct\n");
              else printf("Not Correct\n");
             }
             return 0;
            }


            文章來源:http://www.cnblogs.com/qnbs1/archive/2010/03/21/1691073.html
            posted on 2010-03-21 17:56 藍(lán)牙 閱讀(65) 評論(0)  編輯 收藏 引用

            只有注冊用戶登錄后才能發(fā)表評論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            久久精品国产半推半就| 久久香蕉综合色一综合色88| 久久国产精品无| 欧美午夜精品久久久久免费视| 国产成人久久精品一区二区三区 | 久久男人中文字幕资源站| 国产色综合久久无码有码| 精品国产福利久久久| 欧美黑人激情性久久| 色综合久久久久| 午夜精品久久久久久毛片| 日本高清无卡码一区二区久久 | 99久久99久久精品国产| 国产精品久久久香蕉| 九九久久精品国产| 久久国产精品-久久精品| 国色天香久久久久久久小说 | 亚洲狠狠综合久久| 久久国产精品成人片免费| 久久这里只精品99re66| 久久久精品久久久久久 | 伊人久久大香线蕉av不卡| 久久久久久国产精品免费免费| 99久久国语露脸精品国产| 伊人久久精品无码二区麻豆| 久久久久香蕉视频| 日本久久中文字幕| 久久综合九色综合欧美就去吻| 好属妞这里只有精品久久| 久久国产高潮流白浆免费观看| 久久亚洲AV无码精品色午夜| 一级a性色生活片久久无| 久久久精品国产亚洲成人满18免费网站| 久久免费精品一区二区| 日本精品久久久久中文字幕8 | 国产成人久久久精品二区三区| 国产精品美女久久久久网| 国产精品久久成人影院| 91精品久久久久久无码| 日韩精品无码久久一区二区三| 久久亚洲国产成人影院网站|