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
Explain the importance of signaling in the telephone network.
k0ka [10]

Answer: Please see below as the answer is self-explanatory

Explanation:

In a telephone system, we call signaling to all signals that are originated within a telephony circuit, that are not part of the conversation between the calling parties.

We include in this broad category, the signal generated by the calling party when he picks up the phone, the call tone sent to him by the switch (or the busy tone if the call can't be established due to blocking), the digits that identify the called party, the ringing signal that informs the called party that someone is trying to reach him for a call, among others like are defined in the SS7 or the different 2G/3G/4G Cellular standards.

The importance of the signalling is pretty obvious; without these signals, it will be virtually impossible to set up a connection between the two parties.

8 0
4 years ago
Aside from the smart cell phones used by a billion people, list and describe four
Pie
Gaming Computers- High processing speed and designed to be used for gaming.
Handheld Computers- The things that are being used by Billions of people. Firstly designed as an Internet Browser, now can be used in gaming and office purposes
Mainframe Computers- The large boxes (computers) that you see in server rooms. Designed to be used on processing large quantities of data on the same time.
Office Computers- The things you see in your office. Cheap computers that is undercut in processing speed, and designed to run Office applications.
that's​all I know. have a good day :)
5 0
3 years ago
Which writing format is also beneficial to public speaking? a. Five paragraph essay c. Conventions b. Prose d. None of these
garri49 [273]
convention writing is beneficial to public speaking because writing conventions such as spelling,punctuation,capitalization and grammar help make a student content clear and understandable audience can finish reading without having to stop to try to figure out what was actually intended,the value of learning these writing becomes clear.<span />
4 0
3 years ago
Read 2 more answers
ConnectWeb, Inc., an Internet service provider (ISP), supplies information to the Federal Trade Commission concerning possible u
Yuki888 [10]

Answer:

A Safe Harbor

Explanation:

ConnectWeb, Inc., an Internet service provider (ISP), supplies information to the Federal Trade Commission concerning possible unfair or deceptive conduct in foreign jurisdictions. For this disclosure, federal law gives ConnectWeb and other ISPs immunity from liability. This is a Safe Harbor.

5 0
3 years ago
What are some of the challenges that could arise from setting up a file management system on a computer?
adell [148]
What are some of the challenges that could arise from setting up a file management system on a computer
3 0
3 years ago
Other questions:
  • Prior to the world wide web as we know it today, the internet was chaotic, without any ____.
    9·1 answer
  • For what reasons would someone use online reading tools? Check all that apply. to enhance critical-thinking skills to improve un
    5·2 answers
  • What is this effect in photoshop or photography?
    12·2 answers
  • (15 POINTS) Integrated Circuits Of Made Up Of _____ That Carry The Electrical Current.
    10·1 answer
  • Write a test program that prompts the user to enter three sides of the triangle (make sure they define an actual triangle), a co
    5·1 answer
  • LaShawn would like to post photos in a social media app, but the program needs to be modified in order to display a greater vari
    12·2 answers
  • Which sentence describes a biotechnology method of treating sulfur liquor in the paper industry?
    11·1 answer
  • If you answer I will mark brainliest!!! I want to be able to see two websites on my screen at the same time, how do I do that on
    9·1 answer
  • “If the information ______________________, then that information (should / should not) be stored because _____________. For exa
    10·1 answer
  • Which workbook view is used most often in Excel?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!