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

Presentation Error!!啊!!!帮帮忙!!

Posted by Newy at 2005-05-08 23:21:34 on Problem 1102
#include <stdio.h>
#include <fstream.h>

void main()
{
	ofstream outf("test.txt");
	char number[10][5][4]={{{' ','-',' ','\0'},{'|',' ','|','\0'},{' ',' ',' ','\0'},{'|',' ','|','\0'},{' ','-',' ','\0'}},{{' ',' ',' ','\0'},{' ',' ','|','\0'},{' ',' ',' ','\0'},{' ',' ','|','\0'},{' ',' ',' ','\0'}},{{' ','-',' ','\0'},{' ',' ','|','\0'},{' ','-',' ','\0'},{'|',' ',' ','\0'},{' ','-',' ','\0'}},{{' ','-',' ','\0'},{' ',' ','|','\0'},{' ','-',' ','\0'},{' ',' ','|','\0'},{' ','-',' ','\0'}},{{' ',' ',' ','\0'},{'|',' ','|','\0'},{' ','-',' ','\0'},{' ',' ','|','\0'},{' ',' ',' ','\0'}},{{' ','-',' ','\0'},{'|',' ',' ','\0'},{' ','-',' ','\0'},{' ',' ','|','\0'},{' ','-',' ','\0'}},{{' ','-',' ','\0'},{'|',' ',' ','\0'},{' ','-',' ','\0'},{'|',' ','|','\0'},{' ','-',' ','\0'}},{{' ','-',' ','\0'},{' ',' ','|','\0'},{' ',' ',' ','\0'},{' ',' ','|','\0'},{' ',' ',' ','\0'}},{{' ','-',' ','\0'},{'|',' ','|','\0'},{' ','-',' ','\0'},{'|',' ','|','\0'},{' ','-',' ','\0'}},{{' ','-',' ','\0'},{'|',' ','|','\0'},{' ','-',' ','\0'},{' ',' ','|','\0'},{' ','-',' ','\0'}}};
	char c;
	int s;
	while(1)
	{
		char n[10]={'\0'};
	    scanf("%d",&s);
		getchar();
		for(int num=0;num<9;num++)
		{
	        scanf("%c",&c);
			if(c=='\n') break;
			n[num]=c;
		}
		if(s==0&&n[0]=='0') break;
	    for(int i=0;i<5;i=i+2)
		{
			for(int k=0;k<num;k++)
			{
		       for(int j=0;j<3;j++)
				{
					if(j==1)
					{
						int r=0;
						while(r<s)
						{
							printf("%c",number[n[k]-'0'][i][j]);
							outf<<number[n[k]-'0'][i][j];
							r++;
						}
						continue;
					}
					printf("%c",number[n[k]-'0'][i][j]);
					outf<<number[n[k]-'0'][i][j];
				}
			   printf(" ");
			   outf<<" ";
			}
			   printf("\n");
			   outf<<endl;
			if(i<4)
			{int p=0;
			  while(p<s)
			  {
			    for(int k=0;k<num;k++)
				{
			       for(int j=0;j<3;j++)
				   {
					   if(j==1)
					   {
						  int r=0;
						  while(r<s)
						  {
							printf("%c",number[n[k]-'0'][i+1][j]);
							outf<<number[n[k]-'0'][i+1][j];
							r++;
						  }
						  continue;
					   }
					   printf("%c",number[n[k]-'0'][i+1][j]);
					   outf<<number[n[k]-'0'][i+1][j];
				   }
				   printf(" ");
				   outf<<" ";
				}
				p++;
				printf("\n");
				outf<<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