Python basic eleventh day -re module

reModular common method findall() Returns all eligible results in a list. 1 import re 2 print(re.findall('\d','a1b2c2abc123'))#['1', '2', '2', '1', '2', '3'] View Code search() Finding the first matching information returns an object containing matching information (returning None if not found), which looks at the result through the group () function 1 import re 2 3 str = 'a1b2c2abc123' 4 print(re.search('\d', str).group()) # 1 View Code match() Starting from string, location matching, others with search () 1 import re 2 3 str = 'a1b2c2abc123' 4 print(re.match('\d', s...

Summary of brush problems (Miscellaneous)

【CSummary of language completion function Under the header file < math.h&gt, four rounds, five entries, upwards rounding, and down rounding. See the documentation. Four homes and five entries:double round(double arg);//Returns the nearest integer to arg.  Rounding up:double ceil(double arg);//Returns the smallest integer that is not less than arg.  Down to rounding:double floor(double arg);//Returns the largest integer greater than arg.  Examples: #include <stdio.h> #include <math.h>//round(),floor(),ceil() int main() { //Rounding printf("round(+2.33) = %+.1f...

1137 Final Grading

Title: sorting problems. Idea: Unordered_map is used to store the mapping between the examinee’s name and the score information structure. The score is initialized to – 1. Each score is updated when reading the data. Finally, the final score is calculated and the qualified students are saved into vector, and then sorted. It is important to note thatWhen calculating final results, remember “G must be rounded up to an integer”. The summing up function is summarized here. Code: #include <iostream> #include <string> #include <unordered_map> #include <...

JSP-EL expression

1. EL syntax and usage   EL(Expression Language)It is to make JSP easier to write.   1、Grammatical structure     ${The name attribute value of the domain object}   2、Method of value acquisition     From small to large: page, request, session, application     If it is found, it shows, if it is not found, it continues to look up, and if it is not found in the application, it displays an empty string     If you need to fetch the value of the specified domain scope, you can set the corresponding domain scope (pageScope, requestScope, session Scope, ...

Brothers Lian Linux operation and maintenance learning notes

The latest classic Linux operation and maintenance brothers, Linux operation and maintenance learning notes,, ————— 1.5 times the entire play, refueling, I will be able to finish Linux———————-UnixDevelopment history of LinuxIntroduction of open source softwareLinuxApplication areaLinuxLearning methods——————-Unix:Ken Baer, from the American Laboratory of Baer.1971In 2004, Denis Ricci invented the C language.———LinuxThe system was born in 1991, written by -Linus, Finla...

Euler Fermat little theorem theorem (proof and deduction)

Euler’s theorem: > positive integer. a , n  > φ(n)  is the Euler function.(1~n) Andn  coprime. a,n >, son, that is to say. > because there are φn n >:(aφn -1)X1 * X2 * …… * Xφn ≡ 0 (mod n)    n is coprime, so, (aφn -1)| n“.aφn≡1(mod n).” The Euler theorem is proved.   , any integer.a

Using vue-cli to build element-ui project

Recently, when using element-ui to build a project, I found it unfriendly for beginners to configure various files to run element-ui only with webpack. Think of using vue-cli to build the entire Vue project. 1.Install node.js 2.Install webpack Global install webpack command npm install webpack -g 3.Installation of Taobao mirror [fast speed children’s shoes can be omitted]. 1 npm install -g cnpm --registry=https://registry.npm.taobao.org 4.vueScaffold global installation — used to generate Vue templates npm install -g vue-cli Understanding it as a way to get you started quic...

1136 A Delayed Palindrome

A little bit. Ideas: large integer addition, palindrome number judgment. It is also necessary to determine whether the number of first input is palindrome, so we use do… While instead of while. Code: #include <iostream> #include <string> #include <algorithm> using namespace std; bool judge(const string &str) { int i=0,j=str.size()-1; while(i<=j){ if(str[i]!=str[j]) return false; i++; j--; } return true; } string add(const string& s1,const string& s2) { string sum; int carry=0,temp,d; for(int i=s1.siz...