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, 21.06.2019 22:30
Aprovides legal protection for something an individual has created
Answers: 1
question
Computers and Technology, 22.06.2019 03:30
Write a computer program to calculate the three-phase fault current for a fault at f in figure 1.16, with the network normal, and with one line at a time removedproblems 1.1 write a computer program to calculate the three-phase fault current for a fault at f in figure 1.16, with the network normal, and with one line at a time removed 20 power system relaying from service. the positive-sequence impedance data are given in the accompanying table. use the commonly made assumption that all prefault resistance values are (1.0+j0.0) pu, and neglect all resistance values. calculate the contribution to the fault flowing through the cb b and the voltage at that bus. for each calculated case, consider the two possibilities: cb b2 closed or open. the latter is known as the stub-end fault í• figure 1.16 problem 1.1 system data for figure 1.16 from to positive sequence 0.0+j0.1 0.05j0.15 0.04 j0.2 0.01 jo.i 0.015 + j0.15 0.01 j0.19 0.01 +j0.19 0.03+j0.1 0.0+j0.08 6 6 6 from service. the positive-sequence impedance data are given in the accompanying table. use the commonly made assumption that all prefault resistance values are (1.0 + j 0.0) pu, and neglect all resistance values. calculate the contribution to the fault flowing through the cb b1, and the voltage at that bus. for each calculated case, consider the two possibilities: cb b2 closed or open. the latter is known as the “stub-end” fault.
Answers: 2
question
Computers and Technology, 23.06.2019 03:30
Hashtags serve to identify the topic of a given tweet true false
Answers: 2
question
Computers and Technology, 24.06.2019 04:30
Which of the following terms refers to a collection of different types of software that share the goal of infiltrating a computer and making it do something? a- malware b- virus c- spyware d- trojan horse
Answers: 2
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
Questions on the website: 13722361