What's the problem with this code ?
note: i have to write a piece of code where the first in...
Computers and Technology, 10.10.2019 22:30 tinasidell1972
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;
}
'
Answers: 2
Computers and Technology, 22.06.2019 09:30
My mom and i are moving and we don’t have wifi for the next week, i want to know if using a using a hotspot with unlimited data is better than using regular wifi. i’m considering cost, speed, and data sacrifices.
Answers: 1
Computers and Technology, 23.06.2019 06:00
What makes myhexadecimalnumber a child of mynumber? which methods does myhexadecimalnumber inherit directly from the mynumber class? what can an instance of the mynumber class do? what can an instance of the myhexadecimalnumber class do? which methods are overridden? why are they overridden? how many examples of overloading are there? why was this done? where is the super keyword used? what is it doing? why isn’t the incoming value set immediately in the second myhexadecimalnumber constructor? how many examples can you find of an inherited method being called?
Answers: 1
Computers and Technology, 24.06.2019 07:00
Into what form does the barcode reader convert individual bar patterns?
Answers: 1
Computers and Technology, 24.06.2019 12:30
Why does the pc send out a broadcast arp prior to sending the first ping request
Answers: 1
Chemistry, 05.04.2021 22:30
Chemistry, 05.04.2021 22:30
World Languages, 05.04.2021 22:30
Mathematics, 05.04.2021 22:30
Mathematics, 05.04.2021 22:30
Mathematics, 05.04.2021 22:30
English, 05.04.2021 22:30
Engineering, 05.04.2021 22:30
Mathematics, 05.04.2021 22:30
English, 05.04.2021 22:30
Chemistry, 05.04.2021 22:30
Mathematics, 05.04.2021 22:30