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

测试都过了,一直WA,求拯救

Posted by kaiyuanshengshi at 2011-03-30 09:43:37 on Problem 1102
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include<string.h>
using namespace  std;

char n1[]={"- -- -----"};
char n2[]={"|   ||| ||"};
char n3[]={"|||||  |||"};
char n4[]={"  ----- --"};
char n5[]={"| |   | |"};
char n6[]={"|| |||||||"};
char n7[]={"- -- -- --"};

int main(int argc,char**argv)
	{
	  int s;
	  int i,num,j;
	  char n[20];
	  while(1)
		  {
		    cin>>s>>n;
			if(s==0)break;

			int len=strlen(n);
			for (i=0;i<len;i++)
			{  
			   cout<<' ';
			   num=n[i]-'0';
			   for (j=0;j<s;j++)
			   {
			      cout<<n1[num];
			   }
			   cout<<' ';
			   cout<<' ';
			}
			cout<<endl;
			for (i=0;i<s;i++)
				{
				for (j=0;j<len;j++)
				{
				   num=n[j]-'0';
				   cout<<n2[num];
				   for (int k=0;k<s;k++)
				   {
				    cout<<' ';
				   }
				   cout<<n3[num];
				  cout<<' ';
				}
				 cout<<endl;
				}

				for (i=0;i<len;i++)
					{
					  cout<<' ';
					num=n[i]-'0';
					for (j=0;j<s;j++)
						{
						cout<<n4[num];
						}
					cout<<' ';
					cout<<' ';
					}
				cout<<endl;
				
				for (i=0;i<s;i++)
					{
					for (j=0;j<len;j++)
						{
						num=n[j]-'0';
						cout<<n5[num];
						for (int k=0;k<s;k++)
				   {
				   cout<<' ';
				   }
						cout<<n6[num];
						 cout<<' ';
						}
                       cout<<endl;
					}
				for (i=0;i<len;i++)
					{
					  cout<<' ';
					num=n[i]-'0';
					for (j=0;j<s;j++)
						{
						cout<<n7[num];
						}
					cout<<' ';
					cout<<' ';
					}
				cout<<endl;
				cout<<endl;

			

		  }
	 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