2/8/00
COM1100 Winter2000 Yuhong Yin
10
Example
n
Question: print out “Good Morning !” in the following format:
n
G
n
o
n
o
n
d
n
n
M
n
o
n
r
n
n
n
I
n
n
n
g
n
!
n
n
Solution:
s = "Good Morning!";
Int length = s.length();
for (int i = 0; i <= length - 1; i++)
cout << s[i] << endl;