The third annual Blue Bridge Cup Javac Group _ guess Age

Source: Internet
Author: User
Tags ming

/* (Start of program header comment)

* Copyright and version Declaration section of the program

* Copyright (c) 2016, Guangzhou Science and Technology Trade Vocational College, Department of Information Engineering students

* All rights reserved.

* File name: Blue Bridge Cup title

* Author: Pengjunhau

* Completion Date: April 01, 2016

* Version number: 001

* Description part of task and solution method

* Input Description: None

* Description of the problem:

This year's Arbor Day (March 12, 2012), Xiao Ming and his uncle and his small friends to plant trees together. Rest
, Xiao Ming's classmate asked his uncle how old, his uncle said: "I said a topic, see you who first guess!" ”

"Put the day I was born into a 8-digit (month, day less than two pre-complement 0) just can be today
The year, the month, the day divides evenly! ”

He thought, adding: "Give another hint, I was born in June." ”

According to this information, please help Xiao Ming to calculate his uncle's date of birth.

* Program output: The format is 8 digits of the date. For example, if it is June 12, 1948, write: 19480612

* End of comment on the program head

*/

On the code:

public class Main {

public static void Main (string[] args) {
for (int i = 1; i <; i++) {
for (int j = 1; J <; J + +) {
Long k = i*10000+6*100+j;
if (k%2012==0 && k%3==0 && k%12==0 && 2012-i<100) {
System.out.println (k);
}
}
}
}
}

The third annual Blue Bridge Cup Javac Group _ guess Age

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.