1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Stella [2.4K]
3 years ago
14

C++

Computers and Technology
1 answer:
vichka [17]3 years ago
4 0

Answer:

#include <iostream>

#include <map>  

using namespace std;

int main()

{

   map<int, int> numbers;

   cout << "Enter numbers, 0 to finish" << endl;

   int number;

   while (true) {

       cin >> number;

       if (number == 0) break;

       numbers[number]++;

   }

   for (pair<int, int> element : numbers) {

       std::cout << element.first << ": occurs " << element.second << " times" << std::endl;

   }

}

Explanation:

One trick used here is not to keep track of the numbers themselves (since that is not a requirement), but start counting their occurrances right away. An STL map< > is a more suitable construct than a vector< >.

You might be interested in
Which keys should you press to insert a comment? Ctrl+Alt+I Ctrl+Alt+C Ctrl+Alt+O Ctrl+Alt+N Ctrl+Alt+M
MatroZZZ [7]

In OpenOffice Writer, you can insert comments with the Comment option under the Insert tab. Alternatively, you can use the Ctrl+Alt+N keys.

4 0
3 years ago
What is the best Graphics Card you can get in a Gaming Computer? Also what is the RAM do in a Comptuer
saveliy_v [14]

Answer:

For Simple AAA. title games you can get a gtx 1050 ti which can run games decent about 60 fps on med to low settings i my self am running a r7 370 and i play FiveM at 40 fps or gta5 at 60 csgo at 120 fps if you want to go higher go with the best graphics and fps go with something cheap but extreme a RTX 2070 or 2080 and with ram it help the computer run smoother basically imagin what a plate is ram so more plates you have the more food you can store in it untill someone (the computer) uses it all its a quick storage for limited time the more the better usually for gaming a 16gb should be enough

Explanation:

5 0
3 years ago
What is the decimal equivalent of (11000 + 10000)/101?
Arturiano [62]

its answer in binary is 1000 and in decimal is 8.

7 0
3 years ago
Average of Grades - Write a program that stores the following values in five different variables: 98, 87, 84, 100, 94. The progr
liubo4ka [24]

Answer:

Not sure what language, but in python a super basic version would be:

val1 = 98

val2 = 87

val3 = 84

val4 = 100

val5 = 94

sum = val1 + val2 + val3 + val4 + val5

avg = sum / 5

print(avg)

Explanation:

4 0
3 years ago
Write out code for a nested if statement that allows a user to enter in a product name, store the product into a variable called
OlgaM077 [116]

Answer:

product_name = input("Enter product name : ")

if product_name=="pen"or"book"or"box"or"pencil"or"eraser":

   if product_name == "pen":  

       amount = 10

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

   if product_name == "book":

       amount = 100

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

   if product_name == "box":  

       amount = 150

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

   if product_name == "pencil":  

       amount = 5

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

   if product_name == "eraser":

       amount = 8

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

else:  

   print("Item not found!")

Explanation:

The python program is a code of nested if-statements that compares the input string to five items of the first if-statement. For every item found, its code block is executed.

6 0
3 years ago
Other questions:
  • HELLLLLP ill make you brainiest and ill give u a lot of points if you HELP ME Directions Part One.
    12·2 answers
  • The true or false questions.
    5·1 answer
  • What is the energy conversion of solar water heaters?
    12·1 answer
  • Which of the following statements describes a good reason to use lossless audio compression?
    6·1 answer
  • In the __________ Standard, chemical manufacturers, importers, and distributors are required to provide hazard information by wa
    10·1 answer
  • In 3 to 5 sentences, describe whether or not files should be deleted from your computer. Explain you answer.
    14·2 answers
  • to see which employees received 3 or more bonuses. use the highlight cells rules conditional formatting to format cells in the r
    6·1 answer
  • Draw a flowchart to find the average grade in 3 subjects
    7·1 answer
  • What critical-thinking tool is being used when asking the question, "Is there a large enough scope of
    10·1 answer
  • Applications of the e-government​
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!