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