Fourth session (13) Blue Bridge Cup Java Group B final real title

Source: Internet
Author: User
Tags ming

1. Title: Guessing riddles (fill in the blanks)

A puzzle on the Lantern Festival in village A:

Please guessing the Riddle = Please guess by the Light side

Xiao Ming thought, must be each Chinese character represents a number, different Chinese characters represent different numbers.

Please use the computer according to Xiao Ming's ideas, and then submit "please guessing" three words represented by the integer can.

Please submit your answers in the form of a browser in strict format.
Note: Submit only a 3-bit integer, and do not write additional content, such as descriptive text.

1 ImportJava.util.Scanner;2 //Guessing Riddles3  Public classmain{4      Public Static BooleanFintA[]) {//the relationship between A and B5         if(a[1]==a[4]){6             if(a[0]!=a[1]&&a[0]!=a[2]&&a[0]!=a[3]&&a[0]!=a[5]&&a[1]!=a[2]&&a[1]!=a[3 ]&&a[1]!=a[5]&&a[2]!=a[3]&&a[2]!=a[5]&&a[3]!=a[4]&&a[3]!=a[5])7             return true;8         }9         return false;Ten     } One      A      Public Static voidMain (String args[]) { -         inta,b,c[]=New int[6]; -          for(inti=1;i<=9;i++) the              for(intj=0;j<=9;j++) -                  for(intk=0;k<=9;k++) -                     if(i!=j&&i!=k&&j!=k) {//number A is a three-digit number consisting of three different digits -A= (i*10+j) *10+k;//The number of "Please guessing" represents +B=a*a;//"Please guess" the number represented by the light -                         if(b>100000&&b<1000000) {//if B is a 6-digit number +                              for(intl=5;l>=0;l--){ AC[l]=b%10; atB=b/10; -                             } -                             if(f (c) = =true&&c[0]==a/100&&c[5]== (A/10)%10) System.out.println (a); -                         } -                     } -     } in}
Guessing Riddles

Answer: 897

Fourth session (13) Blue Bridge Cup Java Group B final real title

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.