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
Define horizontal scroll bar​
Murrr4er [49]

Answer:

the thing thats on the bottom of your page when you zoom in that makes the page go left and right.

Explanation: birb

4 0
2 years ago
Read 2 more answers
5. Why is adaptability important in the workplace?
vesna_86 [32]

Answer:

because u can adapt a job

Explanation: hmmhmhmmhmhmhmmhhm

THIS HELPS RIGHT??????

8 0
3 years ago
Sending the same messages to a large number of users is called​
Firlakuza [10]

Answer:

Can you give me the options

3 0
3 years ago
A(n) ________
nignag [31]

Answer:

Technical specification document

Explanation:

6 0
3 years ago
Is there such a thing as an ethical reason for unauthorized access to a computer system?
OLga [1]

Meaning of key word here is "unauthorized": We don't have access to use the system. But you are try to accessing an Unauthorized system which is illegal, can be ethical. I think, although not legal in point of where you have to decide of right and wrong. Like if you want to getting information from criminals personal file to catch him then i would be right.

Yes if an administrator want to fix a problem something going on in his/her network wrong,then he/she can access the systems which is attached to network. Like if somebody is trying to access your's network or wifi getting password then you can stop to them use ethically,stop her/him system access to attaching your's network.

6 0
3 years ago
Other questions:
  • How do you create a table in an existing database on Microsoft Access?
    7·2 answers
  • Andy wants to add a script on his website that will automatically update the current date when the script loads in the browser.
    11·1 answer
  • What are three special purpose devices you might find in a data center and what do they do?
    10·1 answer
  • Columns are most useful for which tasks ?
    12·1 answer
  • What term refers to a device or software system that collects environmental information and makes independent decisions.
    6·1 answer
  • A function is executed when it is
    7·1 answer
  • Which of the following are the lines defining the borders of a shape? (1 point)
    12·1 answer
  • Please someone helpp
    12·2 answers
  • Which of the following is the best example of an installation issue?
    6·2 answers
  • 9.19 LAB: Words in a range (lists) Write a program that first reads in the name of an input file, followed by two strings repres
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!