社区讨论
42分,听取wa声一片
B4067[GESP202412 三级] 打印数字参与者 2已保存回复 3
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 3 条
- 当前快照
- 1 份
- 快照标识符
- @mhj0o5ow
- 此快照首次捕获于
- 2025/11/03 18:48 4 个月前
- 此快照最后确认于
- 2025/11/03 18:48 4 个月前
CPP
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,a[10];
cin>>n;int i=1;
while(n>0){
a[i]=n%10;
i++;
n/=10;
}i-=1;
for(int j=i;j>=1;j--){//1
if(a[j]==0){
cout<<".....";
}else if(a[j]==1){
cout<<"****.";
}else if(a[j]==2){
cout<<".....";
}else cout<<".....";
}cout<<endl;
for(int j=i;j>=1;j--){//2
if(a[j]==0){
cout<<".***.";
}else if(a[j]==1){
cout<<"****.";
}else if(a[j]==2){
cout<<"****.";
}else cout<<"****.";
}cout<<endl;
for(int j=i;j>=1;j--){//3
if(a[j]==0){
cout<<".***.";
}else if(a[j]==1){
cout<<"****.";
}else if(a[j]==2){
cout<<".....";
}else cout<<".....";
}cout<<endl;
for(int j=i;j>=1;j--){//4
if(a[j]==0){
cout<<".***.";
}else if(a[j]==1){
cout<<"****.";
}else if(a[j]==2){
cout<<".****";
}else cout<<"****.";
}cout<<endl;
for(int j=i;j>=1;j--){//5
if(a[j]==0){
cout<<".***.";
}else if(a[j]==1){
cout<<"****.";
}else if(a[j]==2){
cout<<".....";
}else cout<<".....";
}
}
回复
共 3 条回复,欢迎继续交流。
正在加载回复...