1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#ifndef NUMBERS_H
#define NUMBERS_H
#include <iostream>
#include <string>
using namespace std;
class Numbers
{
public:
Numbers(int n);
void print();
protected:
private:
int number;
static const string lessThan20[20];
static const string tens[8];
static const string hundred;
static const string thousand;
};
const string Numbers::lessThan20[20] = {"zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen",
"fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"};
const string Numbers::tens[8] = {"twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"};
const string Numbers::hundred = "hundred";
const string Numbers::thousand = "thousand";
#endif // NUMBERS_H
|