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]
2 years ago
14

What's the problem with this code ?

Computers and Technology
1 answer:
Svet_ta [14]2 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
Clickable text or image that takes you to a different site
hichkok12 [17]
A clickable text or image that takes you to a different site is called a Hyperlink or simply a Link.
3 0
2 years ago
Unlike radio frequency identification (RFID) tags, bar codes: Question 30 options: require a reader that tunes into a specific f
iris [78.8K]

Answer:

require direct line-of-sight scanning.

Explanation:

Unlike radio frequency identification (RFID) tags, bar codes require direct line-of-sight scanning. Meaning you need a device that can scan the bar code and the scanner needs to be directly pointing at the barcode without anything in the way. This is because bar codes work by embedding the information in a design of lines that need to be scanned to retrieve the information. If anything gets in the way it interrupts the scanning process and the data is not correctly transmitted. RFID tags on the other hand do not need a direct line of sight since the information is transferred through radiofrequency. This allows the data to be transferred without a line of sight and at a distance of up to 300ft.

8 0
2 years ago
Consider a hypothetical microprocessor generating 16-bit addresses with 16-bit data accesses (i.e. each access retrieves 16 bits
Vlad [161]
A. number of addresses is 65536
b. memory capacity is 128 kbytes or 131072 bytes
c. The last memory address is FFFF which is 65535

8 0
2 years ago
The refresh or reload button is in the browser toolbar and usually looks like a pair of curved arrows. Clicking it will ________
docker41 [41]

Your answer would be

D. Restart the downloading process

5 0
3 years ago
Read 2 more answers
1st answer will get brainliest!
valentina_108 [34]

The answer is program!

5 0
2 years ago
Read 2 more answers
Other questions:
  • What is the one common feature that ties together different social media technologies? All of the social media tools we use toda
    5·2 answers
  • Which three phrases describe a wireframe
    12·1 answer
  • Rachel uses a word processor to write short stories. However, most of her time is spent toying with the keys, rather than in wri
    13·2 answers
  • The most common type of local correction system is
    11·1 answer
  • Consider the following implementation of a class Square:
    12·1 answer
  • The process of searching for a special pattern of symbols within a larger collection of information is called pattern ____.
    12·1 answer
  • What does a data bar in a cell represents​
    12·2 answers
  • Jill is setting up a presentation and wants to use a built-in equation, such as the area of a triangle. To insert this in her pr
    14·2 answers
  • What can you find the under the privacy policy section of a shopping website?
    12·1 answer
  • Of the following online activities, identify the TWO that are most likely to be affected by bandwidth quality
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!