Monday, September 16, 2019

Codeforce A. Soroban

    1. #include < bits/stdc++.h >
    2. using namespace std;
    3. int main()
    4. {
    5. int n;
    6. cin>>n;
    7. if(!n){
    8. cout<<"O-|-OOOO\n";
    9. return 0;
    10. }
    11. while(n){
    12. int m=n%10;
    13. n/=10;
    14. string s="--|OOOOO";
    15. if(m>=5)s[1]='O';
    16. else s[0]='O';
    17. s[m%5+3]='-';
    18. cout<<s<<endl;
    19. }
    20. }

No comments: