// Obtain the root of the quadratic equation ax2 + bx + c = 0. The values of coefficients A (a = 0), B, and C are input by the keyboard.
# Include # Include Using namespace STD;
// Root
Float get_x (float a, float B, float C)
{
Float x1, x2, X;
If (B * B-4 * a * C {
Cout }
Else if (0 = B * B-4 * a * C)
{
X = (-B)/2/;
Cout }
Else
{
X = SQRT (B * B-4 * a * C );
X1 = (-B + x)/2/;
X2 = (-B-x)/2/;
Cout }
Return 0;
}
Void main ()
{
Flo
height: 140px; 3 display: grid; 4 }56 margin: auto; 7 }Demo Program:Demo Code3.5 Horizontal vertical centering on the screenHorizontal vertical centering on the screen is common, and regular login and registration pages are required. To ensure good compatibility, you also need to use the table layout.Core code:1 . Outer{2 Display:Table;3 position:Absolute;4 Height:100%;5 width:100%;6}7 8 . Middle{9 Display:Table-cell;Ten vertical-align:Middle; One} A - . Inner{ - Margin-left:Auto; the Ma
Remember a few years ago, see the "Environmental protection industry standards of the People's Republic of China (hj/t 212-2005): The source of online automatic monitoring (monitoring) system data transmission standards" this agreement, at that time looked at the head is big, finally did not start to design support him. Until recently, the customer said: you VOC instrument good ah, if you can support the HJ212 transmission protocol ...The mind appeare
Given a 2D board and a list of words from the dictionary, find all words in the board.Each word must is constructed from letters of sequentially adjacent cell, where "adjacent" cells is those horizontally or Vertically neighboring. The same letter cell is used more than once in a word.For example,Given Words = ["oath","pea","eat","rain"] and board =[' o ', 'a ', ' a ', ' n '], [' e ', 't ', 'a ', 'e '], [' I ', ' H ', ' K ', ' R '], [' I ', ' f ', ' l ', ' V ' ]Return ["eat","oath"] .Pro
Given a 2D board and a list of words from the dictionary, find all words in the board.Each word must is constructed from letters of sequentially adjacent cell, where "adjacent" cells is those horizontally or Vertically neighboring. The same letter cell is used more than once in a word.For example,Given words = and ["oath","pea","eat","rain"] board =[ [' O ', ' a ', ' a ', ' n '], [' e ', ' t ', ' a ', ' e '], [' I ', ' h ', ' K ', ' R '], [' I ', ' f ', ' l ', ' V ']]Return ["eat","oath"] .c
length:the True length of the string5 * @return: The true length of the new string6 */7 Public intReplaceblank (Char[] String,intlength) {8 //Write your code here9 for(inti = 0; I length;) {Ten //If a space is found One if(String[i] = = "){ A for(intj = length-1; J >= I+1; j--){ -STRING[J+2] =String[j]; - } thestring[i++] = '% '; -string[i++] = ' 2 '; -string[i++] = ' 0 '; -Length = length+2; +}Else{ -i++; +
represents the number of columns of subplots to prepare-Fignum varies from 1 to numrows*numcols and specifies the current subplot (the one used now) We're going to have numrowsxnumcols a subplot,fignum number. In [2]: Fig = plt.figure ()In [3]: Ax1 = Fig.add_subplot (211)In [4]: Ax1.plot ([1, 2, 3], [1, 2, 3]);In [5]: ax2 = Fig.add_subplot (212)In [6]: Ax2.plot
the Axes object that it creates, which you can save with a variable, and then alternate with SCA () to make them the current axes object, and call plot () to draw in it. If you need to draw multiple charts at the same time, you can pass an integer argument to figure () to specify the ordinal of the graph object, and if the object specified by the sequence number already exists, the new object will not be created, but only let it be the current figure object. The following procedure demonstrates
PACF graph fall into the broadband area.MA (q) model, the ACF will intercept at LAG=Q, in the same vein, the values in the ACF graph fall into the broadband area.The model is observed using ACF (autocorrelation coefficient) or pacf (partial autocorrelation coefficient):Fig = Plt.figure (figsize= (12,8)) Ax1=fig.add_subplot (211) FIG = SM.GRAPHICS.TSA.PLOT_ACF (strike_info[' Close '],lags= 40,AX=AX1) ax2 = Fig.add_subplot (
Python implements the method of drawing a straight line cursor between two coordinate axes in matplotlib
This example describes how to draw a straight line cursor between two coordinate axes in matplotlib using Python. Share it with you for your reference. The details are as follows:
Let's take a look at the examples and effects below.
?
1 2 3 4 5 6 7 8 9 10 11 12 13
#-*-Coding: UTF-8 -*- From matplotlib. widgets import MultiCursor From pylab import figure, show, np T = np. a
This article mainly introduces how to draw a straight line cursor between two coordinate axes in matplotlib by using Python. it involves the skills related to the matplotlib module plotting by using Python, for more information about how to draw a straight line cursor between two coordinate axes in matplotlib, see the example in this article. Share it with you for your reference. The details are as follows:
Let's take a look at the examples and effects below.
#-*-Coding: UTF-8-*-from matpl
The example in this article describes how Python implements a line cursor between two axes in matplotlib. Share to everyone for your reference. Specifically as follows:
Take a look at the following examples and effects.
?
1 2 3 4 5 6 7 8 9 10 11 12-13
#-*-Coding:utf-8-*-from matplotlib.widgets import multicursor to Pylab import figure, show, NP t = Np.arange (0.0, 2 .0, 0.01) S1 = np.sin (2*np.pi*t) s2 = np.sin (4*np.pi*t) FIG = figure () Ax1 = Fig.add_subplot (211) Ax1.plot (
"" To
draw multiple children
a figure object can contain more than one child graph (Axes), in Matplotlib, a plot area, called a child graph, with Axes object, you can use subplot () to quickly draw a chart containing multiple child graphs. It is called as follows: the
entire drawing area of the subplot (numrows,numcols,plotnum)
chart is divided into numrows rows and Numcols columns, and then numbering each region in Left-to-right order, The upper-left area is numbered 1. The Plotnum parameter sp
" respectively. GCF () Gets the figure object that represents the chart, and GCA () Gets the Axes object that represents the child graph. Let's run the program in Python and then call GCF () and GCA () to see the current figure and axes objects.
Import NumPy as NP
import Matplotlib.pyplot as Plt
plt.figure (1) # Create Chart 1
plt.figure (2) # Create chart 2
ax1 = Plt.s Ubplot (211) # in Figure 2, create a child figure 1
ax2 = Plt.subplot (
) ')Plt.ylabel (' Votage (MV) ')Plt.xlim ([0.0,5.0])Plt.ylim ([ -1.2,1.2])Plt.grid (' on ') #以上语句不难理解
# #这种方式的优势和不同在以下语句体现. Because of the introduction of the handle, let us more object-oriented, the idea is more clear. of the Code
# #可读性也更高了.
PLT.SETP (line1,lw=2,c= ' G ') #通过setp函数, set the property of the line with the handle line1, C is the shorthand for colorLine1.set_antialiased (False) #通过line1句柄的set_ * property to set line1 propertiesPlt.text (4,0, ' $\mu=100,\\sigma=15$ ') #添加text, not
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.