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

            superman

            聚精會神搞建設 一心一意謀發展
            posts - 190, comments - 17, trackbacks - 0, articles - 0
               :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            Section 2.2 - Preface Numbering

            Posted on 2009-03-28 17:10 superman 閱讀(105) 評論(0)  編輯 收藏 引用 所屬分類: USACO
             1 #include <iostream>
             2 
             3 using namespace std;
             4 
             5 int main()
             6 {
             7     freopen("preface.in""r", stdin);
             8     freopen("preface.out""w", stdout);
             9 
            10     int n;
            11     cin >> n;
            12 
            13     int I, V, X, L, C, D, M;
            14     I = V = X = L = C = D = M = 0;
            15 
            16     while (n)
            17     {
            18         int c = n--;
            19         while (c)
            20         {
            21             if (c >= 1000) { c -= 1000, M++     ; continue; }
            22             if (c >= 900 ) { c -= 900 , C++, M++continue; }
            23             if (c >= 500 ) { c -= 500 , D++     ; continue; }
            24             if (c >= 400 ) { c -= 400 , C++, D++continue; }
            25             if (c >= 100 ) { c -= 100 , C++     ; continue; }
            26             if (c >= 90  ) { c -= 90  , X++, C++continue; }
            27             if (c >= 50  ) { c -= 50  , L++     ; continue; }
            28             if (c >= 40  ) { c -= 40  , X++, L++continue; }
            29             if (c >= 10  ) { c -= 10  , X++     ; continue; }
            30             if (c >= 9   ) { c -= 9   , I++, X++continue; }
            31             if (c >= 5   ) { c -= 5   , V++     ; continue; }
            32             if (c >= 4   ) { c -= 4   , I++, V++continue; }
            33             if (c >= 1   ) { c -= 1   , I++     ; continue; }
            34         }
            35     }
            36 
            37     if (I) cout << 'I' << ' ' << I << endl;
            38     if (V) cout << 'V' << ' ' << V << endl;
            39     if (X) cout << 'X' << ' ' << X << endl;
            40     if (L) cout << 'L' << ' ' << L << endl;
            41     if (C) cout << 'C' << ' ' << C << endl;
            42     if (D) cout << 'D' << ' ' << D << endl;
            43     if (M) cout << 'M' << ' ' << M << endl;
            44 
            45     return 0;
            46 }
            47 
            中文字幕久久亚洲一区| 国产福利电影一区二区三区久久老子无码午夜伦不| 久久久久久久综合日本亚洲| 久久精品国产男包| 一本久久a久久精品vr综合| 中文字幕乱码人妻无码久久| 国产成年无码久久久久毛片| 久久狠狠一本精品综合网| 久久天天躁狠狠躁夜夜躁2014| 日产精品久久久久久久性色| 亚洲天堂久久精品| 国产精品成人99久久久久| 久久婷婷人人澡人人爽人人爱| 成人妇女免费播放久久久| 青青草原综合久久大伊人精品| 国内精品九九久久精品| 国产精品视频久久| 精品多毛少妇人妻AV免费久久| 91精品国产91久久| 久久综合给合久久狠狠狠97色| 亚洲国产精品综合久久一线| 久久精品国产亚洲沈樵| 人妻精品久久久久中文字幕69| 国产精品久久精品| 久久国产精品99精品国产| 久久狠狠爱亚洲综合影院| 人妻无码久久精品| 青青草国产精品久久久久| 久久精品欧美日韩精品| 久久99九九国产免费看小说| 国产精品青草久久久久婷婷| 亚洲AV无码久久精品成人 | 无码人妻久久一区二区三区免费 | 久久精品国产男包| 欧美成a人片免费看久久| 人人狠狠综合久久亚洲88| 99999久久久久久亚洲| 久久99国产亚洲高清观看首页| 亚洲欧美成人综合久久久| 午夜久久久久久禁播电影| 香蕉久久av一区二区三区|