add Chapter 4 Question 2
This commit is contained in:
parent
d986e73f12
commit
e59770121a
1 changed files with 19 additions and 0 deletions
19
ch04/02.cpp
Normal file
19
ch04/02.cpp
Normal file
|
@ -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…
Reference in a new issue