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 yanzhu at 2009-03-28 11:31:35 on Problem 3173
#include<iostream>
using namespace std;
int main()
{
	int n,m,x;
	cin>>n>>m;
       
	for(int i=0;i<n;i++)
	{	x=m;
		for(int j=0;j<i;j++)
		{
			cout<<" ";
		if(j<n-1)
			cout<<" ";
		}
		for(int k=0;k<n-j;k++)
		{
			if(x+k<=9)
			cout<<x+k;
			else
				cout<<x+k-9;

			if(k<n-1)
				cout<<" ";

			if(x+k+i<=9)
			x=x+k+i;
			else
				x=x+k+i-9;
		}
		if(x+i<=9)
		   m=m+i+2;
		else
			m=m+i+2-9;
		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