Submission

Status:

----------

Subtask/Task Score:

0/100

Score: 0

User: ST68031

Problemset: ผลรวมตัวเลข

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-11 13:44:36

#include <bits/stdc++.h>
using namespace std;
int main(){
    string top[6] = {"   ", "   ", " * ","* *","* *","* *"};
    string middle[6] = {" * ", "* *", " * ","   "," * ","* *"};
    string bottom[6] = {"   ", "   ", " * ","* *","* *","* *"};
    int x;
    cin >> x;
    int a = x / 100;
    int b = (x / 10) % 10;
    int c = x % 10;
    if(a > 0 && a < 7 && b > 0 && b < 7 && c > 0 && c < 7){
        cout << top[a - 1] << "|" << top[b - 1] << "|" << top[c - 1] << endl;
        cout << middle[a - 1] << "|" << middle[b - 1] << "|" << middle[c - 1] << endl;
        cout << bottom[a - 1] << "|" << bottom[b - 1] << "|" << bottom[c - 1] << endl;
    }
    else{
        cout << "ERROR";
    }
}