python-Exercise 5

Source: Internet
Author: User

-Title Description:
Enter a positive integer n to n! How many 0 are there at the end of (that is, factorial)? For example: n = 10; N! = 3628800, so the answer is 2;

-Enter a description:
Input as one line, N (1≤n≤1000)

-Output Description:
Output an integer, which is what the topic asks

-Example 1:

Input
10
Output
2
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/A4/3A/wKioL1mmyD3QmZeAAABhPt48Qu8139.png "title=" Screenshot from 2017-08-30 22-13-39.png "alt=" Wkiol1mmyd3qmzeaaabhpt48qu8139.png "/>


Two. Title Description:
has n positive integers that connect them in a row to form one of the largest multi-bit integers. such as: n=3, 3 integers 13,312,343, the largest integer is 34331213. For example: n=4, the maximum number of integers connected to a 4 integer 7,13,4,246 is 7424613.

-Enter a description:
There are several sets of sample samples, each set of test sample contains two lines, the first behavior of an integer n (n<=100), the second row contains n number (each number does not exceed 1000, space separated).

-Output Description:
Each set of data outputs an integer representing the maximum.

-Example 1:

```
-Input
2
12 123
4
7 13 4 246
-Output
12312
7424613


Ideas:

    1. Input n, n to determine the number of n integers

    2. Convert to a string, combining n integers with a loop

    3. Max output Max with built-in function










3. Title Description
"Palindrome string" is a literal reading and anti-read all the same string, such as "level" or "noon" and so on is a palindrome string. Flowers like this kind of a palindrome with symmetrical beauty, and on her birthday she gets two gifts: string A and String B, respectively. Now she's very curious. There is no way to insert string B into string a so that the resulting string is a palindrome string. You accept the flower request, help her to find out how many kinds of insertion method can make the new string is a palindrome string. If string B is inserted differently, consider it a different approach.
For example:
A = "ABA", B = "B". Here are 4 ways to insert B into a:
* Before the first letter of a: "Baba" is not a palindrome
* After the first letter ' a ': "ABBA" is a palindrome
* After the letter ' B ': "ABBA" is a palindrome
* After the second letter ' a ', the word "abab" is not a palindrome.
So the answer to the condition is 2.


-Enter a description:
Each set of input data is a total of two rows.
First behavior String A
Second behavior string b
String lengths are less than 100 and contain only lowercase letters

-Output Description:
Outputs a number that represents the number of methods that form a palindrome after the string B is inserted into the string A.

-Example 1

```
-Input
Aba
B

-Output
2
```


python-Exercise 5

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.