Submission
Status:
--------------------
Subtask/Task Score:
0/100
Score: 0
User: KanemiyaKana
Problemset: Abacus
Language: cpp
Time: 0.002 second
Submitted On: 2026-09-21 21:34:20
#include <iostream>
#include <ostream>
#include <string>
static constexpr char zero[] = {'*', '*', ' ', '-', ' ',
'*', '*', '*', '*', '*'};
static constexpr char one[] = {'*', '*', ' ', '-', '*',
' ', '*', '*', '*', '*'};
static constexpr char two[] = {'*', '*', ' ', '-', '*',
'*', ' ', '*', '*', '*'};
static constexpr char three[] = {'*', '*', ' ', '-', '*',
'*', '*', ' ', '*', '*'};
static constexpr char four[] = {'*', '*', ' ', '-', '*',
'*', '*', '*', ' ', '*'};
static constexpr char five[] = {'*', ' ', '*', '-', ' ',
'*', '*', '*', '*', '*'};
static constexpr char six[] = {'*', ' ', '*', '-', '*',
' ', '*', '*', '*', '*'};
static constexpr char seven[] = {'*', ' ', '*', '-', '*',
'*', ' ', '*', '*', '*'};
static constexpr char eight[] = {'*', ' ', '*', '-', '*',
'*', '*', ' ', '*', '*'};
static constexpr char nine[] = {'*', ' ', '*', '-', '*',
'*', '*', '*', ' ', '*'};
const char *c1;
const char *c2;
const char *c3;
const char *c4;
const char *c5;
const char *c6;
const char *c7;
const char *c8;
const char *getColumn(int digit) {
switch (digit) {
case 0:
return zero;
case 1:
return one;
case 2:
return two;
case 3:
return three;
case 4:
return four;
case 5:
return five;
case 6:
return six;
case 7:
return seven;
case 8:
return eight;
case 9:
return nine;
default:
return nullptr;
}
}
int main() {
std::string input;
std::cin >> input;
int stringlength = input.size();
int digits[8];
int n = input.size();
for (int i = 0; i < n; ++i) {
digits[i] = input[i] - '0';
}
if (n == 8) {
c1 = getColumn(digits[0]);
c2 = getColumn(digits[1]);
c3 = getColumn(digits[2]);
c4 = getColumn(digits[3]);
c5 = getColumn(digits[4]);
c6 = getColumn(digits[5]);
c7 = getColumn(digits[6]);
c8 = getColumn(digits[7]);
} else if (n == 7) {
c1 = getColumn(0);
c2 = getColumn(digits[0]);
c3 = getColumn(digits[1]);
c4 = getColumn(digits[2]);
c5 = getColumn(digits[3]);
c6 = getColumn(digits[4]);
c7 = getColumn(digits[5]);
c8 = getColumn(digits[6]);
} else if (n == 6) {
c1 = getColumn(0);
c2 = getColumn(0);
c3 = getColumn(digits[0]);
c4 = getColumn(digits[1]);
c5 = getColumn(digits[2]);
c6 = getColumn(digits[3]);
c7 = getColumn(digits[4]);
c8 = getColumn(digits[5]);
} else if (n == 5) {
c1 = getColumn(0);
c2 = getColumn(0);
c3 = getColumn(0);
c4 = getColumn(digits[0]);
c5 = getColumn(digits[1]);
c6 = getColumn(digits[2]);
c7 = getColumn(digits[3]);
c8 = getColumn(digits[4]);
} else if (n == 4) {
c1 = getColumn(0);
c2 = getColumn(0);
c3 = getColumn(0);
c4 = getColumn(0);
c5 = getColumn(digits[0]);
c6 = getColumn(digits[1]);
c7 = getColumn(digits[2]);
c8 = getColumn(digits[3]);
} else if (n == 3) {
c1 = getColumn(0);
c2 = getColumn(0);
c3 = getColumn(0);
c4 = getColumn(0);
c5 = getColumn(0);
c6 = getColumn(digits[0]);
c7 = getColumn(digits[1]);
c8 = getColumn(digits[2]);
} else if (n == 2) {
c1 = getColumn(0);
c2 = getColumn(0);
c3 = getColumn(0);
c4 = getColumn(0);
c5 = getColumn(0);
c6 = getColumn(0);
c7 = getColumn(digits[0]);
c8 = getColumn(digits[1]);
} else if (n == 1) {
c1 = getColumn(0);
c2 = getColumn(0);
c3 = getColumn(0);
c4 = getColumn(0);
c5 = getColumn(0);
c6 = getColumn(0);
c7 = getColumn(0);
c8 = getColumn(digits[0]);
}
for (int i = 0; i < 10; i++) {
if (i == 3) {
std::cout << "---------------" << std::endl;
} else {
std::cout << c1[i] << ' ' << c2[i] << ' ' << c3[i] << ' ' << c4[i] << ' '
<< c5[i] << ' ' << c6[i] << ' ' << c7[i] << ' ' << c8[i]
<< std::endl;
}
}
return 0;
}