Sixth annual Blue Bridge Cup Java question-nine array score

Source: Internet
Author: User

1,2,3...9 These nine numbers make up a fraction with a value of exactly 1/3, how does the group method work?

The code is as follows

/** * * @author Administrator * Class Name: Main * Creation time: 2015-5-1 * vesion1.0 */public class main{public static void Test (I                Nt[] x) {int a = x[0]*1000 + x[1]*100 + x[2]*10 + x[3];                                int b = x[4]*10000 + x[5]*1000 + x[6]*100 + x[7]*10 + x[8];        if (a*3==b) System.out.println (A + "" + B); } public static void F (int[] x, int k) {if (k>=x.length) {T                        EST (x);                Return                                } for (int i=k; i<x.length; i++) {{ int t=x[k]; X[k]=x[i];                        x[i]=t;                        } f (x,k+1);                        {int t=x[k]; x[k]=x[i]; x[i]=t; }}} public static void Main (string[] args) {int[] x = {        , 4,5,6,7,8,9};                        f (x,0); }}

Note: More Java resources in Java Tutorial Web

Sixth annual Blue Bridge Cup Java question-nine array score

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.