Several questions of the pen

Source: Internet
Author: User

1. Digital (100!) There are ____ a 0 behind.

Analysis:

This problem is implemented in code, but is a large number of problems, but in the written examination the emphasis should be on the construction

1 to 100, a total of 10,20 of 0 for the mantissa,.., 90,100. A common 5,15 with a mantissa of 5,..., 85,95.

A total of 20 numbers make up the mantissa is 0, so at that time I filled out 20.

Ignoring a few special numbers, 100,75,50,25, they are a special number that can make up 100.

So the answer should be 24.

Code Validation:

Import Java.math.biginteger;public class Main {public static void main (string[] argv) {main m = new Main (); M.test ();} public void Test () {BigInteger num = biginteger.valueof (1); int count = 0;for (int i = 1; i <=; ++i) {num = Num.multipl Y (biginteger.valueof (i));} while (true) {if (Num.mod (biginteger.valueof)! = biginteger.valueof (0)) Break;count++;num = Num.divide ( Biginteger.valueof (10));} System.out.println (count);}}

2.

Several questions of the pen

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.