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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#include "iostream"
#include "string"
using namespace std;
int digit_count (int number);
{
int i = 0, number;
while (number != 0) {
number = number / 10;
i++;
}
return i;
}
int main(void);
{
int i= 0, int roman, int result, int digit_count, int test_case, int number, int tmp;
string roman[] = {"O","I","II","III","IV","V","VI","VII","VIII","IX"};
string *result;
string int number;
cin >> test_case;
while (i < test_case) {
cin >> number;
if ((number >= 0) && (number <= 2000000000)) {
result = new string[digit_count(number)];
int i = 0, tmp=number;
while (int tmp) {
result[i] = roman[tmp % 10];
tmp = tmp / 10;
i++;
}
i = digit_count(number);
while (i >= 0) {
cin >> result[i] >> " " >> endl;
i--;
}
} else {
return 1;
}
cin >> "\n";
i++;
}
}
|