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
A hard drive cannot be partitioned until the device _________ is set.
Elza [17]
Partition(ed) is the answer
8 0
3 years ago
Read 2 more answers
Clicking on the sheet tab with the _______ adds another worksheet to an Excel file.
alekssr [168]
Circled plus sign adds another worksheet
7 0
3 years ago
In computer security what do the rows and columns correspond to in an 'Access Control Matrix'. What does each cell in the matrix
Tcecarenko [31]

Answer:

Explanation:

An Access Control Matrix ACM can be defined as a table that maps the permissions of a set of subjects to act upon a set of objects within a system. The matrix is a two-dimensional table with subjects down the columns and objects across the rows. The permissions of the subject to act upon a particular object are found in the cell that maps the subject to that object.

Summary

The rows correspond to the subject

The columns correspond to the object

What does each cell in the matrix contain? Answer: Each cell is the set of access rights for that subject to that object.

4 0
3 years ago
A family member who hasn’t worked with computers before has decided to change jobs. You’ve been asked to explain some of the bas
Olin [163]

Answer: That due to the specific tasks that needs to be accomplished by each program to make an all encompassing program would be inefficient and full  of bugs

Explanation: try to do something along those lines ex why would MySQL be used to check your essay for grammar  the tasks are on opposite spectrums

8 0
3 years ago
In 2-5 paragraphs, describe the points that Kendra needs to consider when choosing a telecommunications technology to meet her n
never [62]

Answer:

For marketing requirements, various communication mediums like digital communication medium, as well as non digital traditional communication medium can be used. Some like Blogs, Article directories, forums etc. can be used.

However, the AI, ML, DL and the traditional statistical analysis from Data Science can also be used. You need to install on your blog the chat-bots, And through the Chat-bots we can make a data set, that is in fact automatically generated, and contains email, phone numbers, addresses etc, and this data base can be used to run the Amazon Sage-makers. and a lot of meaningful information can be achieved through the prepared data-set through the Sage-maker.

Thus, you can find out quite easily what is good.

Sage maker, Chat bots and Blog technology is quite cost effective as well.

Explanation:

The above details covers all the requirements.

7 0
3 years ago
Other questions:
  • When did the silver market drop sharply, hurting Bolivia's income?
    7·2 answers
  • This toolbar can be used to change the way the text in your presentation looks. Drawing
    5·2 answers
  • Which program can damage your computer
    13·2 answers
  • Blank includes websites that encourage interaction and connection among people businesses and organizations
    14·2 answers
  • EXCEL 2016:
    8·2 answers
  • A national tax preparation firm is accessing industry-specific productivity applications in the cloud; many other tax preparatio
    13·1 answer
  • What should you do if your computer is running slower
    12·1 answer
  • Definition of digital
    9·2 answers
  • Which properties would be useful to know to search for a Word document? Check all that apply.
    7·1 answer
  • In MS Word we can merga cells true or false​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!