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 LarryYe at 2009-09-27 20:04:16 on Problem 1102
#include <iostream>
#include <cstring>
using namespace std;

char num1[11] = {"- -- -----"};
char num2[11] = {"|   ||| ||"};
char num3[11] = {"||| |  |||"};
char num4[11] = {"  ----- --"};
char num5[11] = {"| |   | | "};
char num6[11] = {"|| |||||||"};
char num7[11] = {"- -- -- --"};

int main()
{
	int s;
	char str[20];
	int len,i,j,digit,k;
	while(scanf("%d%s",&s,str))
	{
		if(0 == s)
			break;

		len = strlen(str);

		for(i = 0; i < len; i++)
		{
			digit = str[i] - '0';
			cout<<" ";
			for(j = 0; j < s; j++)
			{
				cout<<num1[digit];
			}
			cout<<" ";
		}
		cout<<endl;
		
		
		for(j = 0; j < s; j++)
		{
			for(i = 0; i < len; i++)
			{
				digit = str[i] - '0';
				cout<<num2[digit];
				for(k = 0; k < s; k++)
				{
					cout<<" ";
				}
				cout<<num3[digit];
			}
			cout<<endl;
		}
		
		
		for(i = 0; i < len; i++)
		{
			digit = str[i] - '0';
			cout<<" ";
			for(j = 0; j < s; j++)
			{
				cout<<num4[digit];
			}
			cout<<" ";
		}
		cout<<endl;
		

		for(j = 0; j < s; j++)
		{
			for(i = 0; i < len; i++)
			{
				digit = str[i] - '0';
				cout<<num5[digit];
				for(k = 0; k < s; k++)
				{
					cout<<" ";
				}
				cout<<num6[digit];
			}
			cout<<endl;
		}

		for(i = 0; i < len; i++)
		{
			digit = str[i] - '0';
			cout<<" ";
			for(j = 0; j < s; j++)
			{
				cout<<num7[digit];
			}
			cout<<" ";
		}
		

		cout<<"\n\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