subject

What's the problem with this code ?
note: i have to write a piece of code where the first input is the number of cases and afterwards names are entered, seperated by a new line, a name can have at most three parts: first name, middle name and last name. it will have at least one part. the last name is always present. the rules of formatting a name are:

*only the first letter of each part of the name should be capital.
*all the parts of the name except the last part should be represented by only two characters. the first character should be the first letter of the part and should be capitalized. the second character should be ".".

'#include
#include
#include
#include

using namespace std;

int main()
{
short t;
cin > > t;

string str[100];

//cin. clear();
//cin. sync();
cin. ignore(); //or getchar();

short i = t;
while(
{
getline(cin, str[t-1]);
cin. ignore();
}

stringstream ss(str[i-1]);
string tmp;
//vector v;

short j;
while(
{
j = 0;
while(ss > > tmp)
{
if(j > = 2)
{
tmp[0] = toupper(tmp[0]);
cout < < tmp < < ends;
}
else
{
tmp = toupper(tmp[0]);
cout < < tmp < < "." < < ends;
j++;
}
}
cout < < endl;
ss < < str[i-1];
}

return 0;
}
'

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:40
"it security policy enforcement and monitoring" respond to the following: describe how monitoring worker activities can increase the security within organizations. describe the rationale that managers should use to determine the degree of monitoring that the organization should conduct. explain the extent to which you believe an organization has the right to monitor user actions and traffic. determine the actions organizations can take to mitigate the potential issues associated with monitoring user actions and traffic.
Answers: 3
question
Computers and Technology, 22.06.2019 17:50
Farah works in an office with two other employees. all three share a printer and an internet connection. the utility that makes this possible is defragger quicktime soho winzip
Answers: 1
question
Computers and Technology, 22.06.2019 22:20
Avariable of the data type arrays is storing 10 quantities. what is true about these quantities? a. the quantities all have different characteristics. b. the quantities all have the same characteristics. c. five quantities have the same and five have different characteristics. d. it is necessary for all quantities to be integers. e. it is necessary for all quantities to be characters.
Answers: 2
question
Computers and Technology, 23.06.2019 11:00
What is the name of the sound effect that danny hears
Answers: 1
You know the right answer?
What's the problem with this code ?
note: i have to write a piece of code where the first in...
Questions
question
Arts, 28.01.2021 21:50
question
Biology, 28.01.2021 21:50
question
English, 28.01.2021 21:50
question
Mathematics, 28.01.2021 21:50
Questions on the website: 13722363