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 bobo0906 at 2011-05-04 10:55:51 on Problem 1102
In Reply To:贡献我的代码 Posted by:seedeed at 2011-03-25 23:20:18
#include<iostream>
using namespace std;
char dis[10][15]={
	' ','-',' ',  '|',' ','|',   ' ',' ',' ',   '|',' ','|',   ' ','-',' ',  //0
	' ',' ',' ',  ' ',' ','|',   ' ',' ',' ',   ' ',' ','|',   ' ',' ',' ',   //1
	' ','-',' ',  ' ',' ','|',   ' ','-',' ',   '|',' ',' ',   ' ','-',' ',  //2
	' ','-',' ',  ' ',' ','|',   ' ','-',' ',   ' ',' ','|',   ' ','-',' ',   //3
	' ',' ',' ',  '|',' ','|',   ' ','-',' ',   ' ',' ','|',   ' ',' ',' ',   //4
	' ','-',' ',  '|',' ',' ',   ' ','-',' ',   ' ',' ','|',   ' ','-',' ',   //5
	' ','-',' ',  '|',' ',' ',   ' ','-',' ',   '|',' ','|',   ' ','-',' ',   //6
	' ','-',' ',  ' ',' ','|',   ' ',' ',' ',   ' ',' ','|',   ' ',' ',' ',  //7
	' ','-',' ',  '|',' ','|',   ' ','-',' ',   '|',' ','|',   ' ','-',' ', //8
	' ','-',' ',  '|',' ','|',   ' ','-',' ',   ' ',' ','|',   ' ','-',' ',  //9
};
int n;
char m[10];
int siz;
void print(int line_num)
{
	int p;
	if((line_num/3)%2)p=n;
	else p=1;
	for(int t=0;t<p;t++)
	{
		for(int i=0;i<siz;i++)
		{
			printf("%c",dis[m[i]-'0'][line_num]);
			for(int j=0;j<n;j++)
				printf("%c",dis[m[i]-'0'][line_num+1]);
			printf("%c",dis[m[i]-'0'][line_num+2]);
			if(i!=siz-1)printf(" ");
			else printf("\n");
		}
	}
}
int main()
{

	while(scanf("%d%s",&n,m)&&n)
	{
		siz=strlen(m);
		for(int i=0;i<5;i++)
			print(i*3);
		printf("\n");
	}

	return 0;
}

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