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:那位牛人帮忙瞅瞅啊 哪里错啦啊??为啥是Wrong answer 明明都输对了嘛In Reply To:那位牛人帮忙瞅瞅啊 哪里错啦啊??为啥是Wrong answer 明明都输对了嘛 Posted by:sdau_10_chaopeng at 2011-03-15 13:43:08 > import java.util.Scanner; > public class Main{ > public static void main(String args[]){ > int a,b,c,d,i; > Scanner sc = new Scanner(System.in); > a = sc.nextInt() ; > for(i=2;i<=a;i++) > for(b=i;b>0;b--) > for(c=b;c>0;c--) > for(d=2;d<=c;d++) > if(i*i*i==(b*b*b+c*c*c+d*d*d)){ > System.out.println("Cube = "+i+", Triple = ("+d+","+c+","+b+")"); > } > } > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator