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

Re:很不好意思.我是这样过掉了,在你的去掉了一个语句而已(62ms).哈哈..

Posted by level at 2007-02-09 19:48:22 on Problem 1543
In Reply To:很不好意思.我是这样过掉了,在楼下的加了一个语句而已.哈哈.. Posted by:xiaohuang at 2005-08-19 20:41:38
#include<stdio.h>
int main()
{
	int n,i,j,k,s;
	scanf("%d",&n);
	for(i=6;i<=n;i++)		
		for(j=2;j<i;j++)
			for(k=j;k<i;k++)
				for(s=k;s<i;s++)
					if(i*i*i==j*j*j+k*k*k+s*s*s)
						printf("Cube = %d, Triple = (%d,%d,%d)\n",i,j,k,s);
					//else if(i*i*i<j*j*j+k*k*k+s*s*s)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