关于数字打印
  • 板块灌水区
  • 楼主_Chjich_
  • 当前回复3
  • 已保存回复3
  • 发布时间2023/12/3 16:39
  • 上次更新2023/12/3 19:12:33
查看原帖
关于数字打印
766647
_Chjich_楼主2023/12/3 16:39
#include <bits/stdc++.h>
using namespace std;
int i = 0, a[10001];
string s;

int main() {
	cin >> s;
	for (int e = 0; e <= s.length(); e++) {
		a[e] = s[e] - '0';
		i = a[e];
		if (i == 0) {
			cout << " _" << endl;
			cout << "| |" << endl;
			cout << "|_|" << endl;
		}
		if (i == 1) {
			cout << "  " << endl;
			cout << "  |" << endl;
			cout << "  |" << endl;
		}
		if (i == 2) {
			cout << " _" << endl;
			cout << " _|" << endl;
			cout << "|_ " << endl;
		}
		if (i == 3) {
			cout << " _" << endl;
			cout << " _|" << endl;
			cout << " _|" << endl;
		}
		if (i == 4) {
			cout << "  " << endl;
			cout << "|_|" << endl;
			cout << "  |" << endl;
		}
		if (i == 5) {
			cout << " _" << endl;
			cout << "|_ " << endl;
			cout << " _|" << endl;
		}
		if (i == 6) {
			cout << " _" << endl;
			cout << "|_ " << endl;
			cout << "|_|" << endl;
		}
		if (i == 7) {
			cout << " _" << endl;
			cout << "  |" << endl;
			cout << "  |" << endl;
		}
		if (i == 8) {
			cout << " _" << endl;
			cout << "|_|" << endl;
			cout << "|_|" << endl;
		}
		if (i == 9) {
			cout << " _" << endl;
			cout << "|_|" << endl;
			cout << " _|" << endl;
		}
	}
	return 0;
}

怎么样才能把输出怎么变成横的???

2023/12/3 16:39
加载中...