模拟算盘

#include<bits/stdc++.h>
using namespace std;
int main()
{
char s[20];
scanf("%s",&s);
int len=strlen(s);
for(int i=len-1;i>=0;i--)
{
if(s[i]>='5'&&s[i]<='9')
{
printf("-O|");
for(int j=1;j<=s[i]-'5';j++)
printf("O");
printf("-");
for(int j=1;j<='9'-s[i];j++)
printf("O");
printf("\n");
}
else
{
printf("O-|");
for(int j=1;j<=s[i]-'0';j++)
printf("O");
printf("-");
for(int j=1;j<='4'-s[i];j++)
printf("O");
printf("\n");
}
}
return 0;
}

版权声明:本文博客原创文章,博客,未经同意,不得转载。

Codeforces 363A Soroban的更多相关文章

  1. codeforces #363a Launch of Collider

    A. Launch of Collider time limit per test 2 seconds memory limit per test 256 megabytes input standa ...

  2. codeforces 363A

    #include<stdio.h>//这题挺有意思小学学的算盘 int main() { int n,i,m; while(scanf("%d",&n)!=EO ...

  3. python爬虫学习(5) —— 扒一下codeforces题面

    上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...

  4. 【Codeforces 738D】Sea Battle(贪心)

    http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...

  5. 【Codeforces 738C】Road to Cinema

    http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...

  6. 【Codeforces 738A】Interview with Oleg

    http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...

  7. CodeForces - 662A Gambling Nim

    http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概 ...

  8. CodeForces - 274B Zero Tree

    http://codeforces.com/problemset/problem/274/B 题目大意: 给定你一颗树,每个点上有权值. 现在你每次取出这颗树的一颗子树(即点集和边集均是原图的子集的连 ...

  9. CodeForces - 261B Maxim and Restaurant

    http://codeforces.com/problemset/problem/261/B 题目大意:给定n个数a1-an(n<=50,ai<=50),随机打乱后,记Si=a1+a2+a ...

随机推荐

  1. rhel6使用的版本数部分intel xeon处理器时间bug

    可惜在总前几天"oracle操作和维护的高级别小组"于.BBQ 上帝说,大量RHEL的bug.这bug在这个例子中,下面的URL: https://access.redhat.co ...

  2. executeBatch()相关操作汇总

    环境:oracle使用PreparedStatement的executeBatch方法,如果DML操作成功,返回值[-2,-2,...]an array of update counts contai ...

  3. android tips—NumberPicker,DataPicker,TimePicker样式改动

    在使用NumberPicker.DataPicker,TimePicker这几个控件时,非常easy出现例如以下这个界面 可是我们想要的却是以下图示的结果 改动Application.activity ...

  4. nyoj 322 Sort 【树阵】

    这个问题实际上是在测试树的数组. 代码: #include <cstdio> #include <cstring> int c[1005]; int lowbit(int x) ...

  5. .NET(C#):浅谈程序集清单资源和RESX资源

    原文:.NET(C#):浅谈程序集清单资源和RESX资源   目录 程序集清单资源 RESX资源文件 使用ResourceReader和ResourceSet解析二进制资源文件 使用ResourceM ...

  6. UVa 208 - Firetruck 回溯+剪枝 数据

    题意:构造出一张图,给出一个点,字典序输出所有从1到该点的路径. 裸搜会超时的题目,其实题目的数据特地设计得让图稠密但起点和终点却不相连,所以直接搜索过去会超时. 只要判断下起点和终点能不能相连就行了 ...

  7. Model绑定

    Model绑定 在前面的几篇文章中我们都是采用在URI中元数据类型进行传参,实际上ASP.NET Web API也提供了对URI进行复杂参数的绑定方式--Model绑定.这里的Model可以简单的理解 ...

  8. ubuntu14.04(64位置) ADB Not Responding

    今天装了一个很搞笑的比率Ubuntu14.04  还安装Android studio    写app   执行错误: Adb not responding. you can wait more or ...

  9. Git客户端(Windows系统)的使用(Putty)(转)

    本文环境: 操作系统:Windows XP SP3 Git客户端:TortoiseGit-1.8.14.0-32bit 一.安装Git客户端 全部安装均采用默认! 1. 安装支撑软件 msysgit: ...

  10. JavaScript通告/订阅的例子

    原文链接: Pub/Sub JavaScript Object原始日期: 2014年6一个月11日本: 2014年6月13日 翻译人员: 铁锚 高效AJAX站点的三大杀器: 事件代理, 浏览历史管理, ...