由买买提看人间百态

topics

全部话题 - 话题: mmmcmxcix
(共0页)

发帖数: 1
1
来自主题: Military版 - MMMCMXCIX这个太不方便鸟
MMMCMXCIX
这个太不方便鸟
r***e
发帖数: 29
2
来自主题: JobHunting版 - BBC 编程风格面试题,求指教
题目如下。
Roman Numerals
The purpose of this exercise is not simply to solve the problem, instead, we
are interested in how you approach the problem.
Please complete the coding exercise and then submit the code listing to your
email contact at the BBC. Please explain your approach, assumptions made,
or caveats to your solution and add these to the email.
You should spend no more than 30mins on your solution.
The problem
In whatever language you prefer, write a class that implements the following
in... 阅读全帖
r***e
发帖数: 29
3
来自主题: JobHunting版 - BBC 编程风格面试题,求指教
我的答案(C++):
#pragma once
#ifndef _ROMON_HEADER_
#define _ROMON_HEADER_
#include
#include
using namespace std;
const string ROMON_DIGIT[] = {"","I","II","III","IV","V","VI","VII","VIII","
IV"};
//ROMON 0-9
const int ROMON_SCALE[] = {10, 50, 100, 500, 1000};
const char ROMON_SCALE_REP[] = {'X', 'L', 'C', 'D', 'M'};
//ROMON scale
const int ROMON_MAX = 3999;
const int ROMON_MIN = 1;
// rewrite the interface
class RomanNumeralGenerator
{
public:
virtual string generator(int n... 阅读全帖
c********h
发帖数: 191
4
来自主题: Football版 - NFL要有麻环,超级碗寿命有限
俺研究了一下罗马数字表示,发现远不是那么简单。
首先,你们猜猜下面是第几届,不许google
XLIX,
XLIV,
LX,
CD,
LXX,
LXXVIII,
更绝的是 CCCXCIX是399届,呐,这个 MMMCMXCIX呢?3999届,我晕
然后第4000届?对不起,罗马人不识数,没有这个表示,罗马人内存溢出。
呵呵,看来超级碗寿数3999年。
(共0页)