| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
有点水,但是请注意哦。ABCD都是大于1的。#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator