๐Ÿ’ป Dev & CSC++ Programming

C++ Programming Ch.2 Exercise 2 Solution

Problem: cout๊ณผ << ์—ฐ์‚ฐ์ž๋ฅผ ์ด์šฉํ•˜์—ฌ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ตฌ๊ตฌ๋‹จ์„ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜๋ผ. Objective & Hints: cout ํ™œ์šฉ, ํ™”๋ฉด ์ถœ๋ ฅ Execution Result: Code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #include using namespace std; int main() { int i, j; for(i=1; i<10; i++){ for(j=1; j<10; j++) { cout << j << "x" << i << "=" << j*i << '\t'; if(j==9) // 9๋‹จ ์ถœ๋ ฅ ํ›„ ์ค„๋ฐ”๊ฟˆ. cout << endl; } } return 0; } Explanation: ...

February 28, 2020 ยท 1 min ยท Sobamemil
๐Ÿ’ป Dev & CSC++ Programming

C++ Programming Ch.2 Exercise 1 Solution

Problem: cout๊ณผ << ์—ฐ์‚ฐ์ž๋ฅผ ์ด์šฉํ•˜์—ฌ, 1์—์„œ 100๊นŒ์ง€ ์ •์ˆ˜๋ฅผ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ•œ ์ค„์— 10๊ฐœ์”ฉ ์ถœ๋ ฅํ•˜๋ผ. ๊ฐ ์ •์ˆ˜๋Š” ํƒญ์œผ๋กœ ๋ถ„๋ฆฌํ•˜์—ฌ ์ถœ๋ ฅํ•˜๋ผ. Execution Result: Objective & Hints: cout ํ™œ์šฉ, ํ™”๋ฉด ์ถœ๋ ฅ Code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 #include using namespace std; int main(){ int i; for(i=1;i<101;i++){ cout << i << "\t"; if(i%10==0) // 10๊ฐœ๋งˆ๋‹ค ๊ฐœํ–‰๋ฌธ์ž ์ถœ๋ ฅ cout << endl; } return 0; } Explanation: ...

February 28, 2020 ยท 1 min ยท Sobamemil