【开源】画数字

#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;
}

posted @ 2023-11-30 16:17  daiyulong  阅读(19)  评论(1编辑  收藏  举报