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 23:00
In which part of a professional email should you try to be brief, but highly descriptive?
Answers: 1
question
Computers and Technology, 23.06.2019 01:10
Problem 1 - hashing we would like to use initials to locate an individual. for instance, mel should locate the person mark e. lehr. note: this is all upper case. generate a hash function for the above using the numbers on your telephone. you know, each letter has a number associated with it, so examine your telephone keypad. generate 512 random 3 letter initials and take statistics on a linked list array size 512 to hold this information report how many have no elements, 1 element, 2 elements, does this agree with the hashing statistics distribution?
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
Worth 50 points answer them bc i am not sure if i am wrong
Answers: 1
question
Computers and Technology, 24.06.2019 21:30
What need most led to the creation of the advanced research projects agency network? darpa wanted scientists to be able to collaborate and share research easily. darpa wanted american and russian politicians to be able to communicate. darpa wanted astronauts to be able to contact nasa and the white house. darpa wanted factory owners to be able to coordinate supply chains.
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
History, 25.11.2020 14:00
question
Mathematics, 25.11.2020 14:00
Questions on the website: 13722360