Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

各位高手帮帮忙,哪里错了?

Posted by huk at 2005-04-16 23:54:24 on Problem 1102
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator