codeforces 363A

#include<stdio.h>//这题挺有意思小学学的算盘
int main() {
int n,i,m;
while(scanf("%d",&n)!=EOF) {
if(n==0) {
printf("O-|-OOOO\n");
continue;
}
while(n) {
m=n%10;
if(m>=5) {
printf("-O|");
m-=5;
}
else
printf("O-|");
for(i=1;i<=m;i++)
printf("O");
printf("-");
for(i=m+1;i<5;i++)
printf("O");
printf("\n");
n/=10;
}
}
return 0;
}
posted @ 2013-11-20 20:04  HYDhyd  阅读(106)  评论(0编辑  收藏  举报