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 4998544981 at 2009-04-28 22:14:10 on Problem 1543
#include<stdio.h>
int main()
{
	int a,i,j,k,l,x1,x2,x3,x4;
	scanf("%d",&a);
	for(i=2;i<=a;i++)
	{
		x1=i*i*i;
		for(j=2;j<=i;j++)
		{	
		   x2=j*j*j;
		   for(k=j+1;k<=i;k++)
		   {
			   x3=k*k*k;
			   for(l=k+1;l<=i;l++)
			   {
				   x4=l*l*l;
			       if(x2+x3+x4==x1)
				   printf("Cube = %d, Triple = (%d,%d,%d)\n",i,j,k,l);
			   }
		   }
		}
	}
	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