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
Alexxandr [17]
3 years ago
14

What's the problem with this code ?

Computers and Technology
1 answer:
Svet_ta [14]3 years ago
4 0
Hi,

I changed your program using some of the concepts you were trying to use. Hopefully you can see how it works:

#include <string>
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
   short T;
   cin >> T;
   cin.ignore();

   string str[100];

   for(int i=0; i<T; i++)
   {
      getline(cin, str[i]);
   }

   for (int i = 0; i < T; i++)
   {
      stringstream ss(str[i]);
      string tmp;
      vector<string> v;

      while (ss >> tmp)
      {
          // Let's capitalize it before storing in the vector
          if (!tmp.empty())
          {
              transform(begin(tmp), end(tmp), std::begin(tmp), ::tolower);
              tmp[0] = toupper(tmp[0]);
           }
           v.push_back(tmp);
        }

        if (v.size() == 1)
        {
           cout << v[0] << endl;
        }
        else if (v.size() == 2)
        {
           cout << v[0][0] << ". "  << v[1] << endl;
        }
        else
        {
            cout << v[0][0] << ". " << v[1][0] << ". " << v[2] << endl;
        }
    }

     return 0;
}

You might be interested in
Will Give Brainliest
DENIUS [597]

Answer:

I would think Creativity, but im not sure-

6 0
3 years ago
What is computer virus​
IRINA_888 [86]

Answer:

A type of malicious code or program written to alter the way a computer operates and is designed to spread from one computer to another.

Once a virus has successfully attached to a program, file, or document, the virus will lie dormant until circumstances cause the computer or device to execute its code. In order for a virus to infect your computer, you have to run the infected program, which in turn causes the virus code to be executed.

8 0
3 years ago
Read 2 more answers
Drag each tile to the correct box. Arrange the statements in sequence to correctly explain what the field of science includes. a
erastova [34]

These refer to the elementary steps of the scientific method.

The correct order is as follows:

  • Keen observation of natural phenomena.

  • The use of imagination and creativity to test understanding and predictions.

  • An attempt to verify the understanding of observed natural occurrences establishing verifiable scientific knowledge

  • Continued observance and testing to revise scientific knowledge.

  • An understanding of how or why these natural phenomena occur.

Learn more about the scientific methods at the link below:

brainly.com/question/497944

3 0
3 years ago
You can press and hold [Tab] and click the Normal button on the status bar to display the slide master.
tester [92]

Answer:

False.

Explanation:

No, By pressing and holding tab and clicking the normal button on the status bar will not help you in opening the slide master. By holding the shift key and pressing the first icon as shown in this figure will open the slide master for you.

5 0
3 years ago
Read 2 more answers
The purpose of project management is _____. executing a requirement improvement working toward a common goal completing a projec
Anna11 [10]

Answer:

working toward a common goal.

Explanation:

Project management can be defined as the process of designing, planning, developing, leading and execution of a project plan or activities using a set of skills, tools, knowledge, techniques and experience to achieve the set goals and objectives of creating a unique product or service.

Generally, projects are considered to be temporary because they usually have a start-time and an end-time to complete, execute or implement a project plan.

Furthermore, the main purpose of project management is working toward a common goal.

This ultimately implies that, project managers should ensure adequate attention and time is taken to identify, analyze and manage capital, raw materials, people, system of tasks and other resources, so as to effectively and efficiently achieve a common goal with all project stakeholders.

The fundamentals of Project Management which are universal across all fields and businesses includes;

1. Project initiation.

2. Project planning.

3. Project execution.

4. Monitoring and controlling of the project.

5. Adapting and closure of project.

In conclusion, it is very important and essential that project managers in various organizations, businesses and professions adopt the aforementioned fundamentals in order to successfully achieve their aim, objectives and goals set for a project.

3 0
3 years ago
Other questions:
  • on 5.7.3, we provide an outline of a solution to the dining-philosophers problem using monitors. This problem will require imple
    6·1 answer
  • Mrs. Johnson is here today to receive an intercostal nerve block to mitigate the debilitating pain of her malignancy. Her cancer
    13·1 answer
  • (Java)
    12·1 answer
  • (True/False). If the definition of an IS is the medium for recording and storing data, and disseminating information, this would
    12·2 answers
  • Professionalism is defined as what?<br> ASAP PLEASE!
    11·1 answer
  • What are the two main objectives associated with data mining? uncovering competitors and market advantages uncovering tactics an
    15·1 answer
  • What does the following code alert?
    10·2 answers
  • Write the definition of a function named swapints that is passed two int reference parameters. The function returns nothing but
    6·1 answer
  • The file format that an application can always open a named collection of data on a storage medium such as a hard disk or usb fl
    13·1 answer
  • Write a method named removeDuplicates that accepts as a parameter a List of integers, and modifies it by removing any duplicates
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!