Java Classic Programming question 50-way 44

Source: Internet
Author: User

An odd number of 0~7 that can be composed.
Analysis: The composition of 1 digits is 4, composed of 2 digits is 7*4, the composition of 3 digits is 7*8*4, composed of 4 digits is 7*8*8*4 ...

public class Example44 {
public static void Main (string[] args) {
f ();
}

public static void F () {
int sum = 4;
Int J;
System.out.println ("composed of 1 digits is" + sum + "one");
sum = sum * 7;
System.out.println ("composed of 2 digits is" + sum + "one");
for (j = 3; J <= 9; j + +) {
sum = sum * 8;
System.out.println ("composition" + j + "Number of digits is" + sum + "x");
}
}
}

Java Classic Programming question 50-way 44

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.