Codeforces 363A Soroban
模拟算盘
#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的更多相关文章
- codeforces #363a Launch of Collider
A. Launch of Collider time limit per test 2 seconds memory limit per test 256 megabytes input standa ...
- codeforces 363A
#include<stdio.h>//这题挺有意思小学学的算盘 int main() { int n,i,m; while(scanf("%d",&n)!=EO ...
- python爬虫学习(5) —— 扒一下codeforces题面
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...
- 【Codeforces 738D】Sea Battle(贪心)
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...
- 【Codeforces 738C】Road to Cinema
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...
- 【Codeforces 738A】Interview with Oleg
http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...
- CodeForces - 662A Gambling Nim
http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概 ...
- CodeForces - 274B Zero Tree
http://codeforces.com/problemset/problem/274/B 题目大意: 给定你一颗树,每个点上有权值. 现在你每次取出这颗树的一颗子树(即点集和边集均是原图的子集的连 ...
- CodeForces - 261B Maxim and Restaurant
http://codeforces.com/problemset/problem/261/B 题目大意:给定n个数a1-an(n<=50,ai<=50),随机打乱后,记Si=a1+a2+a ...
随机推荐
- 玩转Web之JavaScript(四)-----javaScript语法总结(四) JS中的函数
1.function/return function用来定义函数(位于head部分),函数包含着一些代码,这些代码只能被事件激活,或者在函数被调用时才会执行. return 用来从函数中返回值 ...
- hdu 5030 Rabbit's String(后缀数组&二分法)
Rabbit's String Time Limit: 40000/20000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others ...
- iOS 中国排序
这里分享一个中国某种方便的方法,我们放在一起的人脉资源后,方便的类别,使用自己的包, 此处所使用的方法贴,源代码可以在本文的结尾下载. 要记得加头文件 #import "NSArray+So ...
- ZOJ1463:Brackets Sequence(间隙DP)
Let us define a regular brackets sequence in the following way: 1. Empty sequence is a regular seque ...
- 简单搜索dfs, 简单的修剪搜索
选择最合适的语言做一个项目是非常重要的.但,熟练的掌握自己的武器,这也是非常重要的. ========================================================= ...
- 百度地图 iOS SDK - 坐标转换方法
百度地图 Android SDK 要么 iOS SDK 或各种 API 工具产品,我们使用百度自己的加密坐标系. 员在使用过程中,位置点都是通过 GPS 或者其它途径获取的.所以与百度地图所使用的坐标 ...
- Team Foundation Server 2015使用教程--团队项目删除
- STL源代码分析——STL算法merge合并算法
前言 因为在前文的<STL算法剖析>中.源代码剖析许多.不方便学习.也不方便以后复习,这里把这些算法进行归类.对他们单独的源代码剖析进行解说.本文介绍的STL算法中的merge合并算法. ...
- NSIS:使用WinVer.nsh头文件判断操作系统版本
原文 NSIS:使用WinVer.nsh头文件判断操作系统版本 AtLeastWin<version> 检测是否高于指定版本 IsWin<version> 检测指定版本(唯一限 ...
- Doug Lea
如果IT的历史,是以人为主体串接起来的话,那么肯定少不了Doug Lea.这个鼻梁挂着眼镜,留着德王威廉二世的胡子,脸上永远挂着谦逊腼腆笑容,服务于纽约州立大学Oswego分校计算机科学系的老大爷. ...