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 ...
随机推荐
- mysql5.6设置主从报错1236,Increase max_allowed_packet on master,原因却是Binlog偏移量不对
在试Mysql5.6,搭了个主从: CHANGE MASTER TO MASTER_HOST='1.2.3.4', master_user='slave', master_password='xxxq ...
- 开放Nginx在文件夹列表功能
nginx在列出的默认同意整个文件夹.你怎么转Nginx在文件夹列表功能?打开nginx.conf文件.在location server 要么 http段增加 autoindex on;另外两个參数最 ...
- JTextAreaDemo
问题:java swing 图形界面程序,拖了一个JTextArea出来,程序中有很多地方调用JTextArea中的append这个方法不断往文本域结尾处追加数据,但是程序每次运行,总是在程序运行完成 ...
- JAVA学习(二):JDK介绍及其结构、用途
JDK介绍及其结构.用途 1.JDK的介绍 JDK是Java Development Kit 的缩写.是Sun Microsystems针对Java开发员的产品.它由一个处于操作系统层之上的执行环境还 ...
- onethink和phpwind共享
将onethink和phpwind数据库安装在一起.使用公用表前缀. 将onethink的member表点phpwind有user表 这是onethink在根文件夹的安装,phpwind安装在bbs的 ...
- boostrap-非常好用但是容易让人忽略的地方------row
row是非常好用但是却非常容易忽略的地方. 想实现内部元素相对父级的padding=0,则在父子中间加个row.如下图 列嵌套也是同样的道理 经验之谈:学会row的用法,在手机版布局的时候会很方便,否 ...
- Nginx+Php-fpm+MySQL+Redis源码编译安装指南
说明:本教程由三部分组成如下: 1. 源码编译安装Nginx 2. 源码编译安装php以及mysql.redis扩展模块 3. 配置虚拟主机 文中所涉及安装包程序均提供下 ...
- NSIS:使用WinVer.nsh头文件判断操作系统版本
原文 NSIS:使用WinVer.nsh头文件判断操作系统版本 AtLeastWin<version> 检测是否高于指定版本 IsWin<version> 检测指定版本(唯一限 ...
- oracle PL/SQL(procedure language/SQL)程序设计之函数+过程+包(转)
匿名PL/SQL块回顾 DECLARE (可选) 定义在PL/SQL块中要使用的对象 BEGIN (必须) 执行语句 EXCEPTION (可选) 错误处理语句 END; (必 ...
- MBProgressHUD 问题
1.MBProgressHUD *HUD = [[MBProgressHUD alloc] initWithWindow:[UIApplication sharedApplication].keyWi ...