Given a sorted list of integers, output the middle integer. a negative number indicates the end of the input (the negative number is not a part of the sorted list). assume the number of integers is always odd.
ex: if the input is: 2 3 4 8 11 -1
the output is:
middle item: 4
the maximum number of inputs for any test case should not exceed 9. if exceeded, output "too many numbers". hint: first read the data into a vector. then, based on the number of items, find the middle item. 276452.1593070
(must include vector library to use vectors)

Answers

Answer 1

inputs=[]

num_inputs=int(input())

if(num_inputs>9):

   print("Too many inputs")

else:

   print(num_inputs)

   for i in range(num_inputs):

       inputs.append(input())

   print(inputs)

   middle_position=int(num_inputs/2)

   print(inputs[middle_position])


Related Questions

You are writing code for a custom mobile device app, and for security reasons, you want to prevent tampering and the ability of others to read the code. Which technique will accomplish the requirement

Answers

Obfuscating programming code, often called code camouflaging, is done using a software development plug-in. The result is an unreadable variation of the original readable text.

Christian has malware that is preventing him from installing anti-malware on his laptop. What can Christian try if he does not have another computer available to run the anti-malware program

Answers

If he does not have another computer available to run the anti-malware program then.Try to put it in Windows RE. Create a digital gadget and defloration the anti-malware program.

What is Antivirus?

Antivirus is vital even in case you are on a Mac or Windows device, which each includes a few stages of virus safety constructed in. For general safety with endpoint safety and response, and blocks in opposition to malware and probably undesirable programs, it is fine to put in a third-celebration antivirus software program.

Antivirus is a type of software program used to prevent, scan, discover, and delete viruses from a computer. Once installed, the maximum antivirus software program runs mechanically withinside the heritage to offer real-time safety in opposition to virus attacks. Try to put it in Windows RE. Create a digital gadget and defloration the anti-malware program.

Read, more about the program:

https://brainly.com/question/1538272

#SPJ1

You are sharing your computer screen to collaborate on a document. Which view should you use to minimize the ribbon and give your document the most screen space?.

Answers

The view that you should use to minimize the ribbon and give your document the most screen space is Read Mode (Windows) or Focus (Mac).

What is Microsoft read mode?

Microsoft Office is one that gives a lot of different views for documents, and one of which is read mode.

Note that the Read Mode was set to help remove distractions while reading and working on document.

Therefore, The view that you should use to minimize the ribbon and give your document the most screen space is Read Mode (Windows) or Focus (Mac).

See options below

Read Mode (Windows) or Focus (Mac)

Draft view

Web Layout view

Outline view

Learn more about computer from

https://brainly.com/question/24540334

#SPJ1

You have inserted a video on a slide and want the video to automatically start two seconds after the associated slide appears. How can you accomplish this?.

Answers

To be able to automatically start two seconds after the associated slide appears, it is better to use animation timings.

What is animation timing in PowerPoint?

The timings or the Duration option is known to be an option that informs the PowerPoint how long it will take for the slide to complete or for the text to show up on the screen.

Based on the above, To be able to automatically start two seconds after the associated slide appears, it is better to use animation timings.

Learn more about animation from

https://brainly.com/question/18260878


#SPJ1

A new wifi router is installed at a customer's home. which actions can be taken to provide the minimum layer of security while using the latest router features

Answers

Upgrade the customer's router to the latest version to improve network security.

You have implemented a network where each device provides all other devices on the network with access to shared files. What type of network do you have

Answers

Based on the above scenario,  the type of network that you have is known as the  peer to peer network.

What is  peer-to-peer network?

In this network, all the host can give network resources to other hosts or a form of access to  resources located on other hosts, and each host is said to often be in charge of controlling access to all these resources.

Note that Polling is a media access way where one device gives permission to other devices to access the network and as such, Based on the above scenario,  the type of network that you have is known as the  peer to peer network.

Learn more about peer to peer network from

https://brainly.com/question/10571780

#SPJ1

You are an application developer. You are writing a program to exchange video files through a TCP/IP network. You need to select a transport protocol that will guarantee delivery. Which TCP/IP protocol would you implement that provides this capability? RIP TCP IP TFTP UDP

Answers

Most likely tftp it’s definitely not udp

What is exactly meant by the term coding in context of computer science?

Answers

Answer:

writing instructions for the computer that the computer can interpret

Explanation:

Other Questions
WILL GIVE BRAINLIEST!!!! Which of the following is an example of an exponential function?f(x) = 4x^3 + 2x^2 3x + 9g(x) = log2(x)^3h of x equals the quantity x squared plus 2x minus 7 end quantity divided by the quantity x plus 1p(x) = 500(1.02)^x a consistent supply of grain from egypt helped roman officials avoid which problem? what is the measure of the angle in degrees 11. Graph.y - 2 = -2 (x + 2) arts7 mudule3 quarter4 This is slightly urgent. Does anyone know how to cross multiply and divide 1/5 and 20/x? It would look like this if you need the equation.1/5 * 20/x the fourth goal of foreign policy Venus and Earth may be regarded as behaving as black bodies. The mean temperature at the surface of Venus is about 600 K and at the surface of Earth is about 300 K. Which of the following is the best estimate for the ratio \frac{\text{power radiated per unit area on Earth}}{\text{power radiated per unit area onVenus}} power radiated per unit area onVenus power radiated per unit area on Earth question: the solutions of a quadratic equation are x=-7 and 5. which could represent the quadratic equation and why? What is the original starting color for the Glucose indicator? A certain buffalo population increases by a factor of 1.2 each year. Of the following which best approximates the factor by which the population will increase over a ten year period? What does ! mean in a math problem? Why do the colors in the light spectrum bend at different angles when they pass through a prism?The colors in the light spectrum have the same wavelength.The colors in the light spectrum have different wavelengths.The colors in the light spectrum have different refractive indices.The colors in the light spectrum have the same refractive indices. Escoge la mejor respuesta. Select the best answer.La pintura Las dos Fridas, pintada por Frida Kahlo en 1939, es sin duda unade las pinturas ms reconocidas de Frida Kahlo. Las dos Fridas es unautorretrato de Frida Kahlo que representa una Frida tradicional y unaFrida moderna. Algunos expertos dicen que el autorretrato representa ladoble herencia de Frida y sus padres. Otros dicen que representa surelacin con Diego Rivera. Frida Kahlo pint esta obra maestra despusde su divorcio de Diego Rivera. La capacidad de Las dos Fridas de tenervarios temas ha aumentado su popularidad e importancia.Segn la lectura, por qu es esta pintura tan popular? Las dos Fridas estan popular porque ______________ (1 point)cubre diferentes temas y situacionesO es una pintura bastante grandeO habla sobre la relacin de Frida con sus padreses una pintura muy cara y= 3x-2 find y when x=-5 A market exists when: a physical location is created to facilitate the exchange of personal information about consumer choices. the cost of production is equated to the price by a government agency. people exchange money for goods and services. an absolute advantage is achieved by one country. During the Mongols early campaigns, what was the only group to defeat them?A. the AbbasidsB. the IndiansC. the MamluksWorth 20 points How does the West Nile virus spread?Who is at risk of becoming ill from West Nile virus? An aluminum aerosol can will burst if the pressure inside reaches 210.0 psi. if the can initially contains an ideal gas at 459.5 kpa at 298.15 k, at what temperature (in k) will the can burst? Why is there a 1/2 in this formula for the area of a trapezoid?