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

有点水,但是请注意哦。ABCD都是大于1的。

Posted by 110405221 at 2012-11-08 18:20:14 on Problem 1543
#include <stdio.h>

int main()
{
	int a,b,c,d;
	int i;
	scanf("%d",&a);
	for(i=2;i<=a;i++)
		for(b=2;b<i;b++)
			for(c=2;c<i;c++)
				for(d=2;d<i;d++)
					if((i*i*i==b*b*b+c*c*c+d*d*d)&&(b<c)&&(c<d))printf("Cube = %d, Triple = (%d,%d,%d)\n",i,b,c,d);
	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