add Chapter 4 Question 2

main
kuoi 9 months ago
parent d986e73f12
commit e59770121a

@ -0,0 +1,19 @@
# include <iostream>
using namespace std;
int main(){
/** const int ArSize = 20; **/
/** char name[ArSize]; **/
/** char dessert[ArSize]; **/
string name, dessert;
cout << "Enter your name: " ;
// cin.getline(name,ArSize);
getline(cin,name);
cout << "Enter your dessert: " ;
// cin.getline(dessert,ArSize);
getline(cin,dessert);
cout << "I have some delicious " << dessert << " for you, " << name << "." << endl;
return 0;
}
Loading…
Cancel
Save