罗马数字转阿拉伯数字,还只限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;
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-24
  • 2022-12-23
  • 2021-12-06
  • 2021-10-27
  • 2022-01-30
  • 2021-05-29
  • 2022-12-23
相关资源
相似解决方案