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 xiaohuang at 2005-08-19 20:41:38 on Problem 1543
#include<stdio.h>
#include<cmath>
int main()
{
	int N,i,j,k,m;
	scanf("%d",&N);
	for(i=6;i<=N;i++)
		for(j=2;j<i;j++)
			for(k=j;k<i;k++)
				for(m=k;m<i;m++)
					if(i*i*i==j*j*j+k*k*k+m*m*m)
						printf("Cube = %d, Triple = (%d,%d,%d)\n",i,j,k,m);
					else if(i*i*i<j*j*j+k*k*k+m*m*m) break;///!!!!!
		          
					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