Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
各位高手帮帮忙,哪里错了?#include<iostream.h> #include<string.h> void main(){ char sign1[10]={'-',' ','-','-',' ','-','-','-','-','-'}; char signa[10]={'|',' ',' ',' ','|','|','|','|','|','|'}; char signb[10]={'|','|','|','|','|',' ',' ','|','|','|'}; char sign2[10]={' ',' ','-','-','-','-','-',' ','-','-'}; char signc[10]={'|',' ','|',' ',' ',' ','|',' ','|',' '}; char signd[10]={'|','|',' ','|','|','|','|','|','|','|'}; char sign3[10]={'-',' ','-','-',' ','-','-',' ','-','-'}; int n; char num[9]; while(1){ cin>>n>>num; if(n==0&&strcmp(num,"0")==0) break; for(int i=0;num[i]!='\0';i++){ cout<<' '; for(int j=0;j<n;j++) cout<<sign1[num[i]-'0']; cout<<' '; cout<<' '; } cout<<endl; for(i=0;i<n;i++){ for(int j=0;num[j]!='\0';j++){ cout<<signa[num[j]-'0']; for(int k=0;k<n;k++) cout<<' '; cout<<signb[num[j]-'0']<<' '; } cout<<endl; } for(i=0;num[i]!='\0';i++){ cout<<' '; for(int j=0;j<n;j++) cout<<sign2[num[i]-'0']; cout<<' '; cout<<' '; } cout<<endl; for(i=0;i<n;i++){ for(int j=0;num[j]!='\0';j++){ cout<<signc[num[j]-'0']; for(int k=0;k<n;k++) cout<<' '; cout<<signd[num[j]-'0']<<' '; } cout<<endl; } for(i=0;num[i]!='\0';i++){ cout<<' '; for(int j=0;j<n;j++) cout<<sign3[num[i]-'0']; cout<<' '; cout<<' '; } cout<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator