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
(tco 8) when asp.net receives a request for an application that uses forms-based authentication from a user who hasn't been auth
leonid [27]
Hi,

This what you are looking for: "records incorrect prompt"

Hope this helps.
r3t40
7 0
3 years ago
1. Write a statement that opens the file Customers.dat as a random access file for both reading and writing.
KengaRu [80]

Answer:

Explanation:

In Python you need to give access to a file by opening it. You can do it by using the open() function. Open returns a file object, which has methods and attributes for getting information about and manipulating the opened file.

https://eecs.wsu.edu/~cs150/tutorial/file/code11_3.html

Look at this link it may help.

3 0
3 years ago
How would you classify the earliest historical examples of STEM discoveries provided in this lesson?
Readme [11.4K]
MATHEMATICAL DISCOVERIES
4 0
4 years ago
Read 2 more answers
Tax preparation software can help prepare and file your taxes by _________.
ludmilkaskok [199]

Answer:

B. Posing questions to collect necessary information

Explanation:

Tax preparation software serves as software that makes filing as well as preparation of tax to be easier.

3 0
2 years ago
In most presentation software, custom animations are added from the _____.
77julia77 [94]

Answer:c

Explanation:

6 0
3 years ago
Other questions:
  • Someone may choose to own a car instead of leasing because:
    14·2 answers
  • This software system shall consist of four source files (.cpp) and four header files (.h) defining four classes. The first class
    6·1 answer
  • 40 is 20 % percent of what?​
    9·1 answer
  • Limitations of the information systems used by tesco​
    7·1 answer
  • A domain's ____ settings must be configured correctly so that the mail transfer agent (mta) can establish a connection with a re
    15·1 answer
  • Given a sorted list of integers, output the middle integer. Assume the number of integers is always odd. Ex: If the input is: 2
    13·1 answer
  • What is the output?<br> str = 'abcdef<br> print(str[2:50)
    6·2 answers
  • Which best compares portrait and landscape orientations?
    7·1 answer
  • What is computer forensics? Where and how would an IT auditor use thisresource?
    12·1 answer
  • the php function that is executed is a connection to a database cannot be made is the____ function. die | isset| end | connect.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!