Function checkidcard (strnumber){// ID card number format Function// The citizenship number is a feature combination code,// The Order is from left to right: six-digit address code, eight-digit birth date code, three-digit sequence code, and one-digit verification code.
// Determine the length of the ID card numberIf (
Title: Given a positive three-bit integer, such as 123, output 321, but if it is 700, the output must be 7 cannot be 007What is the idea?Assuming that the positive three-digit number is m, its percentile is C, very bit is B, BITS is a, then there is the following equation.M=c*100+b*10+a*1Now that M is known, as long as you know the value of the three numbers of C, B, a, then we can output it directly in ABC order.So how do you know the value of these
Problem DescriptionWater problemInputEnter a 3-digit number (the title contains multiple sets of test data)OutputSeparates the 3-digit hundred, 10-bit, and single-digit, inverted output (one row of test data per group)Sample Input250Sample Output052HINTSeparating out the numbers, you can use the remainder and the divisor.Note that in C, 2 integers are multiplied
Since the provincial education department made a one or two-grade primary school does not allow the provision of written homework, many math teachers to the parents assigned a special assignment: every day to the children out of the 10 crossing computation, parents correcting and guide the child correction. I was always lazy. After receiving the assignment, I subcontracted the project to the WPS form (ET). and take the table multiplication multi-digit
The meaning of the number of digits in the ID card!
(1) The first 1 and 2 digits indicate the code of the province;
(2) The Code of the city where the user is located is represented by 3rd and 4 digits;
(3) 5th and 6 digits: the code of the Jinniu District and County;
(4) 7th ~ 14 digits indicate the year, month, and day of birth;
(5) 15th and 16 digits indicate the code of the local police station;
(6) 17th digits indicate gender. an odd number indicates male and an even number indicates female
Find rule!
N! The last Non-zero-digit value. For example, 2 is the last value of 120 instead of 0.The input N is large and must be saved in large numbers.Note that the number of the last 0 is equal to the number of five factors. Set f (n) to n! .Then f (n) = (n % 5 )! * F (n/5) * 2 ^ (n/5) % 10The number of factor 2 is always greater than 5. From 1 onwards, each of the five consecutive groups are divided into one group. The multiples of five are extra
ID number 15-digit + 18-digit calculation method:
> Original ID card is 15-bit > The first step is to insert 19 after the sixth digit of the original 15-bit ID card; > This ID number is 17-bit > > Each digit is multiplied by its corresponding factor NBSP;NBSP;NBSP;NBSP > Coefficient table: >
1. Question (from Rosen, "Elementary number theory and its application" 6th P99 5th)The last two decimal digits (bits and 10) that prove the total square number must be one of the following: {xx, E1, E4, O6, E9}Note: E = even number, O = prime number, 0 is also an even number2. Verify
N
N2
End number Pair Type
0
0
00
1
1
E1
2
4
E4
3
9
E9
4
16
E4
Match the 18-bit ID number and the regular expression is as follows:/^[1-9][0-9]{5} (19|20) [0-9]{2} ((01|03|05|07|08|10|12) (0[1-9]|[ 1-2][0-9]|31) | (04|06|09|11) (0[1-9]| [1-2] [0-9]|30] |02 (0[1-9]|[ 1-2][0-9])) [0-9]{3} ([0-9]|x| X) $/Note: Now the ID number is already 18, there is no need to consider matching 15 bit.18-digit ID Number: 6-digit area + 4-year + 4-month-day + 3-
Select a floating-point number of random numbers between A and b
import random
print (random.uniform (2,900))
C: \ python35 \ python3.exe D: / pyproject / day21 module / random random module.py
621.520221600369
7, Shuffle (self, x, random=None)
is to shuffle the elements in the list (in a scrambled order, with no eggs)
import random
ret = [11,22,33,44,55]
random.shuffle (ret)
print (ret)
C: \ python35 \ python3.exe D: / pyproject / day21 module / random random module.
"python exercises 025" a 5-digit number, judging whether it is a palindrome number. That is, 12321 is a palindrome number, single-digit and million-bit the same, 10 bits and thousands of the samex = input(‘请输入任意位数的数字:‘)if x == x[::-1]:print(‘%s是个回文数‘ % x)else:print(‘%s不是回文数‘ % x) "Python3 Exercises 025" A number, judging it is not a palindrome number. That is, 12321 is a palindrome number, single-
Digit counting
Time limit:3000ms Memory Limit:unknown 64bit IO Format:%lld %llu
Submitstatus
Description
Trung is bored with his mathematics homeworks. He takes a piece of chalk and starts writing a sequence to consecutive integers starting with 1 ToN (1
12345678910111213
In this sequence, 0 appears once, 1 appears 6 times, 2 appears 2 times, 3 appears 3 times, and each digit from 4 to 9 AppE Ars once. Aft
Find rule!
N! The last Non-zero-digit value. For example, 2 is the last value of 120 instead of 0.The input N is larger than the limit value and must be saved in large numbers.Note that the number of the last 0 is equal to the number of five factors. Set F (n) to n! .Then f (n) = (N % 5 )! * F (N/5) * 2 ^ (N/5) % 10The number of factor 2 is always greater than 5. Each of the five consecutive groups is divided into one group starting from 1. The multip
Hdu oj 1061 Rightmost Digit (fast power algorithm), hdurightmost
Here we will first explain the quick power algorithm:
Fast modulo Algorithm
I have not found a detailed description and explanation of the quick power algorithm on the website. Here, I provide a complete explanation of the quick power algorithm, using the C language, readers of different languages have to change their positions. After all, many people read C ~
The so-called rapid power
Label: Print 1 to the maximum n digits Description: Enter the number N and print the n-digit decimal number from 1 to the maximum in order. For example, if you enter 3, the number of three digits from 1, 2, and 3 to the maximum is 999. Analysis description: The first thought is to first calculate the maximum N-digit number, and then print it from 1 to the maximum N-
Hdoj Address: http://acm.hdu.edu.cn/showproblem.php?pid=1061Fast Power algorithm Explanation: http://blog.csdn.net/qq_26891045/article/details/51334101Rightmost DigitTime Limit: -/1 theMS (java/others) Memory Limit:65536/32768K (Java/others)Total Submission (s):45746 Accepted Submission (s): 17221 problem DescriptionGiven A positive integer N, you should output the most right digit of n^n.InputThe input contains several test cases. The first line of
Title Link: http://vjudge.net/problem/HDU-1061This topic requires n-n multiplication of bits, the direct result of a positive data overflow.In fact, as long as each time a number to retain the digit and n multiplied on it,Because A*b=c, for the single digit, A (digit) *b (digit) =c (
HDU 1060 Leftmost Digit (number theory)
Leftmost Digit
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission (s): 13680 Accepted Submission (s): 5239
Problem DescriptionGiven a positive integer N, you should output the leftmost digit of N ^ N.
InputThe input contains several test cases. The first line of the input is
1107:0 start-up algorithm 14--three-digit reversal time
limit:1 Sec Memory limit:64 MB 64bit IO Format:%lldsubmitted:4915 accepted:2378[Submit] [Status] [Web Board]
DescriptionWater problemInputEnter a 3-digit number (the title contains multiple sets of test data)OutputSeparates the 3-digit hundred, 10-bit, and single-
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.