hdu 4256大水题

罗马数字转阿拉伯数字,还只限12以内的。。。还有更水的赛题么。。

/*
 * hdu1012/win.cpp
 * Created on: 2012-7-24
 * Author    : ben
 */
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <functional>
#include <numeric>
#include <cctype>
using namespace std;
string nums[13] = {"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"};

int main() {
#ifndef ONLINE_JUDGE
    freopen("data.in", "r", stdin);
#endif
    string num;
    int T = 0;
    while(cin>>num) {
        for(int i = 0; i < 13; i++) {
            if(num == nums[i]) {
                printf("Case %d: %d\n", ++T, i);
            }
        }
    }
    return 0;
}
原文地址:https://www.cnblogs.com/moonbay/p/2607038.html