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 |
很不好意思.我是这样过掉了,在楼下的加了一个语句而已.哈哈..#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator