Submission
Status:
--------------------
Subtask/Task Score:
0/100
Score: 0
User: duduh
Problemset: Abacus
Language: cpp
Time: 0.002 second
Submitted On: 2025-09-21 20:30:07
#include <bits/stdc++.h>
using namespace std;
string a;
int st[8];
int main(){
cin.tie(nullptr)->sync_with_stdio(false);
cin >> a;
int n = a.size() - 1;
int i;
for(i=0;i<8;i++) cout << '*' << ' ';
cout << endl;
for(int j=7;j>=0;j--){
if(j<=n && a[n-j]>='5') {cout << ' '; st[j]=1;}
else cout << '*';
cout << ' ';
}
cout << endl;
for(int j=7;j>=0;j--){
if(st[j]) cout << '*';
else cout << ' ';
cout << ' ';
}
cout << endl;
cout << "-----------------" << endl;
for(i=0;i<8;i++){
for(int j=7;j>=0;j--){
if(j<=n && i == (a[n-j]-'0')%5) cout << ' ';
else if(i==0 && j>n) cout << ' ';
else if(i==0 && a[n-j]%5==0) cout << ' ';
else cout << '*';
cout << ' ';
}
cout << endl;
}
return 0;
}