假期训练——OpenJ_Bailian - 2745 显示器 模拟
来源:互联网 发布:淘宝质量好的杂货铺 编辑:程序博客网 时间:2024/05/16 07:23
如果某行输入包括两个0,表示输入结束。这行不需要处理。
2 123453 678900 0
-- -- -- | | | | | | | | | | | | -- -- -- -- | | | | | | | | | | -- -- -- --- --- --- --- --- | | | | | | | || | | | | | | || | | | | | | | --- --- --- | | | | | | | || | | | | | | || | | | | | | | --- --- --- ---
数(number)由一个或者多个数字组成。
根据每个数字特征列出个数组,然后输出就好了。。
注意为0 的时候。
#include <iostream> #include <cstdio>#include <cstdlib>#include <cmath>#include <algorithm>#include <climits>#include <cstring>#include <string>#include <set>#include <map>#include <queue>#include <stack>#include <vector>#include <list>#define rep(i,m,n) for(int i=m;i<n;i++)#define rsp(it,s) for(set<int>::iterator it=s.begin();it!=s.end();it++)const int inf_int = 2e9;const long long inf_ll = 2e18;#define inf_add 0x3f3f3f3f#define mod 1000000007#define pb push_back#define mp make_pair#define fi first#define se second#define pi acos(-1.0)#define pii pair<int,int>#define Lson L, mid, rt<<1#define Rson mid+1, R, rt<<1|1const int maxn=5e2+10;using namespace std;typedef vector<int> vi ;typedef long long ll;typedef unsigned long long ull; inline int read(){int ra,fh;char rx;rx=getchar(),ra=0,fh=1;while((rx<'0'||rx>'9')&&rx!='-')rx=getchar();if(rx=='-')fh=-1,rx=getchar();while(rx>='0'&&rx<='9')ra*=10,ra+=rx-48,rx=getchar();return ra*fh;}//#pragma comment(linker, "/STACK:102400000,102400000")ll gcd(ll p,ll q){return q==0?p:gcd(q,p%q);}ll qpow(ll p,ll q){ll f=1;while(q){if(q&1)f=f*p;p=p*p;q>>=1;}return f;} //0 1 2 3 4 5 6 7 8 9 int a1[10] ={1,0,1,1,0,1,1,1,1,1};int ble[10]={1,0,0,0,1,1,1,0,1,1};int bri[10]={1,1,1,1,1,0,0,1,1,1};int c1[10] ={0,0,1,1,1,1,1,0,1,1};int dle[10]={1,0,1,0,0,0,1,0,1,0};int dri[10]={1,1,0,1,1,1,1,1,1,1};int e1[10] ={1,0,1,1,0,1,1,0,1,1};vi num;int s,n;int main(){while(cin>>s>>n){num.clear();if(s==0&&n==0){break;} int t = n;if(t==0)num.push_back(0);while(t){num.push_back(t%10);t/=10;}for(int i=num.size()-1;i>=0;i--){cout<<" ";if(a1[num[i]])rep(k,0,s) cout<<"-";elserep(k,0,s) cout<<" ";cout<<" ";cout<<" ";}cout<<endl;rep(i,0,s){for(int k=num.size()-1;k>=0;k--){if(ble[num[k]])cout<<"|";elsecout<<" ";rep(k,0,s)cout<<" ";if(bri[num[k]])cout<<"|";elsecout<<" ";cout<<" ";}cout<<endl;}for(int i=num.size()-1;i>=0;i--){cout<<" ";if(c1[num[i]])rep(k,0,s) cout<<"-";elserep(k,0,s) cout<<" ";cout<<" ";cout<<" ";}cout<<endl;rep(i,0,s){for(int k=num.size()-1;k>=0;k--){if(dle[num[k]])cout<<"|";elsecout<<" ";rep(k,0,s)cout<<" ";if(dri[num[k]])cout<<"|";elsecout<<" ";cout<<" ";}cout<<endl;}for(int i=num.size()-1;i>=0;i--){cout<<" ";if(e1[num[i]])rep(k,0,s) cout<<"-";elserep(k,0,s) cout<<" ";cout<<" ";cout<<" ";}cout<<endl;cout<<endl;} return 0;}
0 0
- 假期训练——OpenJ_Bailian - 2745 显示器 模拟
- 假期训练——OpenJ_Bailian - 2950 摘花生 模拟
- 假期训练——OpenJ_Bailian - 1833 排列 全排序
- 假期训练——OpenJ_Bailian - 4017 爬楼梯 动态规划
- 显示器 OpenJ_Bailian - 2745
- 假期训练—— HDU - 4930 Fighting the Landlords 模拟
- 假期训练——Mahjong HDU - 4431 模拟
- 假期训练—— Repeating Decimals UVA - 202 模拟
- 假期训练——The Blocks Problem UVA - 101 模拟
- 假期训练——The Dole Queue UVA - 133 模拟
- 假期训练——Hangman Judge UVA - 489 模拟
- 假期训练——THE DRUNK JAILER POJ - 1218 模拟
- 假期训练——Puzzle UVA - 227 模拟+DFS and similar
- 假期训练专题及模板——排序
- 假期训练——HDU - 5965 扫雷 多情况考虑
- 假期训练——POJ - 1163 The Triangle dp
- 假期训练——UVA - 10036 Divisibility DP
- poj 2745显示器(模拟)
- 寒假十天集训总结
- 数值的整数次方
- meterpreter详解与渗透实战
- CCF201612-1 中间数(100分)
- Python正则表达式指南
- 假期训练——OpenJ_Bailian - 2745 显示器 模拟
- Codeforces 604B - Alan Wake(二分)
- 使用spring-data-jpa的JpaRepository来进行类的db操作(配置)
- POJ 2488 A Knight's Journey (dfs)
- Tcp C/S架构实现聊天室(数组管理在线用户)(服务器)
- 【Android开发】App版本号
- 基于范德蒙矩阵的Erasure code技术详解
- 假期训练——OpenJ_Bailian - 1833 排列 全排序
- hadoop中使用java.util.ServiceLoader