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 DeanL at 2010-04-04 22:57:28 on Problem 3173
#include<iostream>
using namespace std;
const int K = 22;
char a[K][K];
int main()
{
	int N;
	int S;
	int move = 1;
	cin >> N >> S;
	for (int i = 0;i < N;i++)
	{
		for (int j = 0;j < move;j++)
		{
			if (j > i)
			{
				a[j][i] = ' ';
			}
			else
			{
				if (S == 9)
				{
					a[j][i] = '9';
					S = 1;
				}
				else 
				{
					a[j][i] = S + '0';
					S++;
				}
			}
		}
		move++;
	}
	for (int i = 0;i < N;i++)
	{
		for (int j = 0;j < N;j++)
		{
			cout << a[i][j];
			if (j != N - 1)
				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