【开源】画数字
#include<bits/stdc++.h>
using namespace std;
int num[int(1e8+5)],n;
void paint() {
string pho[7];//1:左 2:右 3:双 4:全 5、6:10
pho[1] = " ▇ ";
pho[2] = " ▇ ";
pho[3] = " ▇ ▇ ";
pho[4] = " ▇▇▇▇▇▇ ";
pho[5] = " ▇ ▇▇▇▇ ";
pho[6] = " ▇ ▇ ▇ ";
int num_pho[11][9] = {{},{2,2,2,2,2,2,2,2,2},
{4,2,2,2,4,1,1,1,4},{4,2,2,2,4,2,2,2,4},{3,3,3,3,4,2,2,2,2},
{4,1,1,1,4,2,2,2,4},{4,1,1,1,4,3,3,3,4},{4,2,2,2,2,2,2,2,2,},
{4,3,3,3,4,3,3,3,4},{4,3,3,3,4,2,2,2,4},{5,6,6,6,6,6,6,6,5}};
for(int line = 0;line<9;line++){
for(int i=1;i<=n;i++){
cout<<pho[num_pho[num[i]][line]];
}
cout<<endl;
}
}
int main() {
char c;
while(cin>>c) {
num[++n]=c-'0';
}
system("cls");
paint();
return 0;
}
本文作者:daiyulong
本文链接:https://www.cnblogs.com/daiyulong/p/kaiyuan-huashuzi.html
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步