#include<bits/stdc++.h> using namespace std; int c[1000]; int main() { int a, i; string b[5]; cin>>a; i=a; cout<<i; b[0] = "..... **. ..... ....."; b[1] = ".*. ****. ***. **."; b[2] = ".. ****. ..... ....."; b[3] = "..... ****. ..... ....."; while (i != 0) { c[i] = i % 10; i /= 10; cout<<i<<" "; } for (int i = 10; i < 0; i--) { if (c[i] == 0) { cout << b[0]; } else if (c[i] == 1) { cout << b[1]; } else if (c[i] == 2) { cout << b[2]; } else if (c[i] == 3) { cout << b[3]; } cout << "\n"; } return 0; } 0分,求修改
#include<bits/stdc++.h>
using namespace std;
int c[1000];
int main() {
int a, i;
string b[5];
cin>>a;
i=a;
cout<<i;
b[0] = "..... ****. ..... .....";
b[1] = ".***. ****. ****. ****.";
b[2] = ".***. ****. ..... .....";
b[3] = "..... ****. ..... .....";
while (i != 0) {
c[i] = i % 10;
i /= 10;
cout<<i<<" ";
}
for (int i = 10; i < 0; i--) {
if (c[i] == 0) {
cout << b[0];
} else if (c[i] == 1) {
cout << b[1];
} else if (c[i] == 2) {
cout << b[2];
} else if (c[i] == 3) {
cout << b[3];
}
cout << "\n";
}
return 0;
}