Shiny Lime Green Star J, '๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก (5 Page)
All
C++
[C++] 7์ฃผ์ฐจ. ์ฝ”๋“œ ํ๋ฆ„๋„, ๋ฆฌ๋ทฐ
#include #include using namespace std;const int ROWS = 10;const int COLS = 6;int seats[10][6]; // 10ํ–‰ 6์—ด์˜ ์ขŒ์„ ๋ฐฐ์—ด ์„ ์–ธ int adultcount = 0;int childcount = 0;int changecount = 0;int totalprice = 0;// ์ขŒ์„ ๋ฐฐ์—ด ์ดˆ๊ธฐํ™” ํ•จ์ˆ˜ //void chogihwaseats() { for (int i = 0; i > choice; switch (choice) { case 1: displayseats(); // ํ˜„์žฌ ์ขŒ์„ ์ƒํƒœ ๋‚˜ํƒ€๋‚ด๋Š” ํ•จ์ˆ˜ ํ˜ธ์ถœ int currentadultcount, currentchildcount; cout > currentadult..
user image
CTF
[5์›”/Dreamhack CTF Season 5 Round #10 (๐ŸŒฑDiv2)] EVER-igen
user image
Python
[์†Œํ”„ํŠธ์›จ์–ด์™€์ฐฝ์˜์ ์‚ฌ๊ณ ] 12์ฃผ์ฐจ. ๋ฐ์ดํ„ฐ ์‹œ๊ฐํ™” ๊ธฐ์ดˆ
# ์ง€๋‚œ ์ฃผ์ฐจ ๋ฆฌ๋ทฐ# ๋ฐ์ดํ„ฐ ์‹œ๊ฐํ™”๋ฐ์ดํ„ฐ๋ฅผ ์ดํ•ดํ•˜๊ธฐ ์‰ฝ๊ฒŒ ์‹œ๊ฐ์ ์œผ๋กœ ํ‘œํ˜„ํ•˜๋Š” ๊ฒƒ๊ฐ™์€ ์ข…๋ฅ˜์˜ ๊ฐ์ฒด(Object)์ƒ์„ฑ์„ ์œ„ํ•ด ์ •์˜๋˜๋Š” ํ‹€ (ํ˜•์‹) # ๊บฝ์€์„  ๊ทธ๋ž˜ํ”„๊บฝ์€์„  ๊ทธ๋ž˜ํ”„๋ฅผ ๊ทธ๋ฆฌ๊ธฐ ์œ„ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๊ฐ€์ ธ์˜ดmatplotlib.pyplotplot() ํ•จ์ˆ˜ ์‚ฌ์šฉplot ํ•จ์ˆ˜ ํ˜•์‹ : plot (x์ถ•, y์ถ•)show() ํ•จ์ˆ˜๋กœ ๋งˆ์นจ# ๋ถ€๊ฐ€์ •๋ณด ๋„ฃ๊ธฐ plt.title() : ์ œ๋ชฉ์„ ๋„ฃ์Œplt.rc() : ํ•œ๊ธ€ ์ฒ˜๋ฆฌ, ()์€ 'font', family = "๊ธ€๊ผด"plt.xlabel() : x์ถ• ๋ ˆ์ด๋ธ”plt.ylabel() : y์ถ• ๋ ˆ์ด๋ธ”# ๋ถ€๊ฐ€์ •๋ณด ๋„ฃ๊ธฐ - ๋งˆ์ปคmarker = "์˜ต์…˜"color = "์˜ต์…˜"# ๋ถ€๊ฐ€์ •๋ณด ๋„ฃ๊ธฐ - ์„  ๋‘๊ป˜(linewidth / ์„  ์Šคํƒ€์ผ(linestyle)linewidth = ์ˆซ์žlin..
user image
C
[Cํ”„๋กœ๊ทธ๋ž˜๋ฐ] 12์ฃผ์ฐจ. ๊ตฌ์กฐ์ฒด
# ๊ตฌ์กฐ์ฒด- ํ•จ์ˆ˜ ์™ธ๋ถ€์— ์ •์˜  · struct ์‚ฌ์šฉ  · ๊ตฌ์กฐ์ฒด ์ •์˜- ๊ตฌ์กฐ์ฒด : ๋ถ•์–ด๋นต ํ‹€- ๊ตฌ์กฐ์ฒด ๋ณ€์ˆ˜ : ๋ถ•์–ด๋นต  · ๊ตฌ์กฐ์ฒด ๋ณ€์ˆ˜ ์„ ์–ธstruct student s1;  · ๊ตฌ์กฐ์ฒด ์ •์˜์™€ ๋ณ€์ˆ˜ ์„ ์–ธ์„ ๋™์‹œ์—  · ๊ตฌ์กฐ์ฒด ๋ณ€์ˆ˜ ์ดˆ๊ธฐํ™”- ์ค‘๊ด„ํ˜ธ๋ฅผ ์ด์šฉํ•ด ์ดˆ๊ธฐ๊ฐ’ ๋‚˜์—ด  · ๊ตฌ์กฐ์ฒด ๋ฉค๋ฒ„ ์ฐธ์กฐ- . ์—ฐ์‚ฐ์ž๋ฅผ ์‚ฌ์šฉ# ์ ๋“ค๊ฐ„์˜ ๊ฑฐ๋ฆฌ ๊ณ„์‚ฐstruct point p1, p2;&p1.x, &p2.y*๊ตฌ์กฐ์ฒด ๋ณ€์ˆ˜ ๋Œ€์ž… O**๊ตฌ์กฐ์ฒด ๋ณ€์ˆ˜ ๋น„๊ต X* # ๊ตฌ์กฐ์ฒด ๋ฐฐ์—ดstruct student list[100];# 4์ง€์„ ๋‹ค ํ€ด์ฆˆ ์‹œ์Šคํ…œbank[i].questionbank[i].solution# ๊ตฌ์กฐ์ฒด ํ•จ์ˆ˜์™€ ํฌ์ธํ„ฐ- ๊ฐ’์— ์˜ํ•œ ํ˜ธ์ถœ ์ ์šฉ- ๋ฐ˜ํ™˜๊ฐ’์œผ๋กœ ์‚ฌ์šฉ ๊ฐ€๋Šฅint *p (p->)# ๊ณต์šฉ์ฒด (union)- ๊ฐ™์€ ๋ฉ”๋ชจ๋ฆฌ ์˜์—ญ..
user image
Python
[์†Œํ”„ํŠธ์›จ์–ด์™€์ฐฝ์˜์ ์‚ฌ๊ณ ] 11์ฃผ์ฐจ. ํ”„๋กœ๊ทธ๋žจ ํ™”๋ฉด ๊ตฌ์„ฑ
# GUI (Graphic User Interface)์‹œ๊ฐ์  ์š”์†Œ๋“ค๋กœ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ๊ตฌ์„ฑํ”„๋กœ๊ทธ๋žจ์˜ ๋‹ค์–‘ํ•œ ๊ธฐ๋Šฅ์„ ๊ทธ๋ž˜ํ”ฝ์œผ๋กœ ๋‚˜ํƒ€๋‚ธ ๊ฒƒ # tkinter ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌํŒŒ์ด์ฌ ํ‘œ์ค€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌํŒŒ์ด์ฌ ์„ค์น˜ ์‹œ ๊ธฐ๋ณธ์ ์œผ๋กœ ๋‚ด์žฅ๊ฐ„๋‹จํ•˜๊ฒŒ GUI ํ”„๋กœ๊ทธ๋ž˜๋ฐ ๊ฐ€๋Šฅimport ํ•ด์„œ ์‚ฌ์šฉ ๊ฐ€๋Šฅ- from tkinter import *- import tkinter *alisa๋ฅผ ์ง€์ •ํ•ด์„œ ํ™œ์šฉํ•  ์ˆ˜๋„ ์žˆ์Œ*- import tkinter as tt https://docs.python.org/ko/3/library/ ํŒŒ์ด์ฌ ํ‘œ์ค€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ฐธ๊ณ  The Python Standard LibraryWhile The Python Language Reference describes the exact syntax and semantics of th..
user image
C
[Cํ”„๋กœ๊ทธ๋ž˜๋ฐ] 11์ฃผ์ฐจ. ๋ฌธ์ž์—ด
# ๋ฌธ์ž์—ด"Hello" ์™€ ๊ฐ™์ด ๋ฌธ์ž๋“ค์˜ ๋ชจ์ž„- ํƒ€์ž… X- ๋ฌธ์žํ˜•(charํ˜•)๋งŒ ์กด์žฌ- ๋ฌธ์žํ˜•์˜ ๋ฐฐ์—ด์— ์ €์žฅchar str[6] = "Hello";- ์•„์Šคํ‚ค์ฝ”๋“œ : 8๋น„ํŠธ ๋ฌธ์ž์ฝ”๋“œ(0~127)- ์œ ๋‹ˆ์ฝ”๋“œ : 16๋น„ํŠธ ๋ฌธ์ž์ฝ”๋“œ NULL ๋ฌธ์ž- ๋ฌธ์ž์—ด ๋์— ๊ผญ NULL ๋ฌธ์ž๋ผ๋Š” ํŠน์ˆ˜ํ•œ ๊ฐ’์œผ๋กœ ๋๋‚˜์•ผ ํ•œ๋‹ค.- ๋ฌธ์ž์—ด์ด ์–ด๋””์„œ ์ข…๋ฃŒ๋˜๋Š”์ง€ ํ‘œ์‹œ๋ฅผ ํ•ด์ฃผ๋Š” ์—ญํ• (์“ฐ๋ ˆ๊ธฐ ๊ฐ’ ๋ถ„๋ฆฌ) ๋ฌธ์ž์—ด ๋ฐฐ์—ด์˜ ์ดˆ๊ธฐํ™”char str[6] = { 'H', 'e', 'l', 'l', 'o', '\0' };char str[6] = "Hello";char str[ ] = "Hello; ์˜ˆ์ œ #๋ฌธ์ž ์ž…์ถœ๋ ฅ ๋ฒ„ํผ# ์•”ํ˜ธ ์ž…๋ ฅ๋ฐ›๊ธฐchar password[10];password[i] = getch();๋ฌธ์ž์—ด ๋์— NULL ๋ฌธ์ž password[i]..
user image