In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this article Xiaobian for you to introduce in detail the "JavaScript polynomial equation output method", the content is detailed, the steps are clear, the details are handled properly, I hope this "JavaScript polynomial equation output method" article can help you solve your doubts, the following follow the editor's ideas slowly in-depth, together to learn new knowledge.
Topic description
The unary nn degree polynomial can be expressed by the following expression:
F (x) = a _ NX ^ n + a _ {n ≠ 1} x ^ {n ≠ 1} x ^ {n color 1} +\ cdots + ne 0f (x) = an?xn+an and 1?xn − 1 examples
Among them, a _ IX ^ Iai? xi is called ii secondary term, a_iai? The coefficient called the ii subterm. Give the degree and coefficient of a unary polynomial, please output the polynomial according to the format specified below:
The independent variable in the polynomial is xx, and the polynomial is given in the order of decreasing degree from left to right.
A polynomial contains only terms with coefficients not equal to 00.
If the polynomial nn degree coefficient is positive, the "+" sign does not appear at the beginning of the polynomial, and if the polynomial nn degree coefficient is negative, the polynomial begins with the "-" sign.
For items that are not the highest order, connect this item with the previous item with a "+" sign or a "-" sign, indicating that the coefficient is positive or negative, respectively. Followed by a positive integer that represents the absolute value of this coefficient (if an item greater than degree 00 has an absolute value of 11, there is no need to output 11). If the index of xx is greater than 11, the next part of the index is in the form of "x ^ BXB", where bb is the index of xx; if the index of xx is 11, the next part of index is "xx"; if the index of xx is 00, only the output coefficient is needed.
In a polynomial, the beginning and end of a polynomial do not contain extra spaces.
Input format
Enter a total of 22 lines
The first row of 11 integers, nn, represents the number of unary polynomials.
The second line has n+1n+1 integers, where the second integer represents the coefficient of the n-ifold 1n − item1 term, separated by a space.
Output format
The output consists of 11 lines and outputs polynomials in the format described in the title.
Input and output sample
Enter # 1 to copy
5 100-1 1-3 0 10
Output # 1 copy
100x ^ 5-x ^ 4 + x ^ 3-3x ^ 2 + 10
Enter # 2 to copy
3-5 000 1
Output # 2 copy
-50x ^ 3 + 1 description / prompt
Question 1 of NOIP 2009 Popularization Group
For 100% data, 0\ le n\ le 1000 ≤ n ≤ 100\ le − 100 ≤ coefficient\ le 100 ≤ 100
# include#includeusing namespace std;int main () {int npentry flag = 0; cin > > n; for (int I = nbizi > = 0polii -) {int a; int temp = n; cin > > a; if (a = 0 | (a = 0 & & I = = 0)) / / coefficient is 0 or when the coefficient is zero and the power of 0 is 0, {flag++ Continue;} if (a > 0) / / coefficient greater than 00:00 {if (I = = 0) / / zero power cout
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.