C++ Programming Ch.2 Exercise 10 Solution
Problem: ๋ฌธ์์ด์ ํ๋ ์ ๋ ฅ๋ฐ๊ณ ๋ฌธ์์ด์ ๋ถ๋ถ ๋ฌธ์์ด์ ๋ค์๊ณผ ๊ฐ์ด ์ถ๋ ฅํ๋ ํ๋ก๊ทธ๋จ์ ์์ฑํ๋ผ. ์์๋ ๋ค์๊ณผ ๊ฐ๋ค. Objective & Hints: ๋ฌธ์์ด ์ฝ๊ธฐ, ๋ฌธ์์ด ๋ค๋ฃจ๊ธฐ Execution Result: Code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #include using namespace std; int main() { cout << "๋ฌธ์์ด ์ ๋ ฅ>>"; char str[100]; cin.getline(str,100); for(int i=1;i<100;i++){ for(int j=0;j<i;j++) { cout << str[j]; } if(str[i]=='\0') // ๋ฌธ์์ด์ ๋์ด๋ฉด break break; cout << endl; } return 0; }