๐Ÿ’ป Dev & CSC++ Programming

C++ Programming Ch.2 Exercise 7 Solution

Problem: ๋‹ค์Œ๊ณผ ๊ฐ™์ด "yes"๊ฐ€ ์ž…๋ ฅ๋  ๋•Œ๊นŒ์ง€ ์ข…๋ฃŒํ•˜์ง€ ์•Š๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜๋ผ. ์‚ฌ์šฉ์ž๋กœ๋ถ€ํ„ฐ์˜ ์ž…๋ ฅ์€ cin.getline() ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๋ผ. Objective & Hints: ๊ณต๋ฐฑ์„ ํฌํ•จํ•˜๋Š” ๋ฌธ์ž์—ด ์ฝ๊ธฐ Execution Result: Code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #include #include using namespace std; int main() { char A[] = "yes"; // ๋ฐฐ์—ด ์„ ์–ธ์‹œ "yes"๋กœ ์ดˆ๊ธฐํ™” char B[100]; while(true){ cout << "์ข…๋ฃŒํ•˜๊ณ  ์‹ถ์œผ๋ฉด yes๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”>>"; cin.getline(B,100); if(strcmp(A,B) == 0) break; } cout << "์ข…๋ฃŒํ•ฉ๋‹ˆ๋‹ค..."; return 0; } Explanation: ...

February 28, 2020 ยท 1 min ยท Sobamemil
ocalStorage.setItem("menu-scroll-position", menu.scrollLeft); } } document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener("click", function (e) { e.preventDefault(); var id = this.getAttribute("href").substr(1); if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) { document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView({ behavior: "smooth" }); } else { document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView(); } if (id === "top") { history.replaceState(null, null, " "); } else { history.pushState(null, null, `#${id}`); } }); });