+ 1
Why does it look like a paragraph of one big word...why is there no spaces...what am I doing wrong...code in comments
5 Respuestas
+ 12
You didn't provide us with any code! That's what you're doing wrong!…… ~_~
+ 7
xD
+ 6
cout << "There once was person named";
Put a space after name just before the " like this: cout << "There once was person named ";
Do that for every cout << "(words) ";
+ 2
string profession;
string animal;
string petname;
cout << "Please enter name: " <<endl;
cin >> name;
cout << "Please enter age: "<< endl;
cin >> age;
cout << "Please enter city: " <<endl;
cin >> city;
cout << "Please enter college: " <<endl;
cin >> college;
cout << "Please enter profession: "<<endl;
cin >> profession;
cout << "Please enter animal: "<<endl;
cin >> animal;
cout << "Please enter petname: "<<endl;
cin >> petname;
cout << "There once was person named";
cout << name << setw(2)<<"who lived in";
cout << city<<"."<<setw(2)<<"At the age of";
cout << age <<","<<setw(2)<< name<<"went to,";
cout << college<<"." <<setw(2)<< name;
cout << "graduated and went to work as a";
cout << profession <<"." << setw(2) <<"Then";
cout << name <<setw(2)<<"adopted a"<<setw(2);
cout << animal <<"," << "named" <<setw(2);
cout << petname <<"." <<setw(2)<<"They lived";
cout << "happily ever after.";
}
+ 2
Thanks Jafca