Codeforces 363A Soroban(算盘模拟)
来源:互联网 发布:配置windows能关机吗 编辑:程序博客网 时间:2024/04/30 00:11
题目大意:
算盘模拟题,从小到大来看,左边珠子向右移动一格为5,右边珠子向左边移动一格+1
由于没0没有特判,WA了一次。
#include <cstdio>#include <cstring>using namespace std;void print(int t) {if(t / 5 == 0) {printf("O-|");}else {printf("-O|");}int tmp = t % 5;for(int i = 0; i < tmp; i++) {printf("O");}printf("-");for(int i = tmp+1; i < 5; i++) {printf("O");}printf("\n");}int main() {int num;while(scanf("%d",&num) != EOF) {int t;if(num == 0) {printf("O-|-OOOO\n");continue;}while(num) {t = num % 10;print(t);num /= 10;}}return 0;}
0 0
- Codeforces 363A Soroban(算盘模拟)
- Codeforces 363A Soroban(算盘模拟)
- Codeforces 363A Soroban-算盘模拟
- codeforces-363A. Soroban
- Codeforces 363A Soroban
- CodeForces 363A - Soroban
- codeforces 363A round211 div2 A.Soroban
- Codeforces #211 (Div. 2) A. Soroban
- Codeforces #211 (Div. 2) A. Soroban
- A.Soroban
- A. Soroban
- A. Soroban----水题
- Codeforces Round #211 (Div. 2), problem: (A) Soroban,problem: (B) Fence,problem: (C)
- CodeForces 349A Cinema Line (模拟)
- codeforces-#465A. inc ARG(模拟)
- Codeforces 2A-Winner(模拟)
- codeforces-#475A. Bayan Bus(模拟)
- CodeForces 2A - Winner(模拟)
- Zoho和Salesforce,谁是更适合中小企业的CRM软件?
- 解决 安装驱动程序后设备管理器中显示黄色问号
- 常用css
- Ubuntu基础操作
- telnet模拟http GET和POST方法
- Codeforces 363A Soroban(算盘模拟)
- Const读书笔记
- svn 放弃修改
- 强大的日志分析工具AWStats
- js 除法 取整
- javaweb学习总结(四十二)——Filter(过滤器)学习
- hollister soldes to save wear uncle
- java 泛型 深入
- Android App Widget创建步骤