전체 글 (104) 썸네일형 리스트형 2025년 C언어 5주차(추가) 1학기 import sys #필요한 것을import해온다stack = [] #스택 생성n = int(sys.stdin.readline())for _ in range(n): x = sys.stdin.readline().strip() #x에 명령어를 집어넣는다. push의 경우 숫자가 함께 들어올 걸 대비하여 strip로 분리한다. if x.startswith('push'): _, y = x.split() stack.append(int(y)) #_는 명령어, y는 숫자값이다. elif x == 'pop': print(stack.pop() if stack else -1) #삼항연산자이다. A if 조건 else B라는.. 2025년 1학기 웹해킹 4주차(드림핵) 함께 실습 일단 엔드포인트 /vuln과 /memo는 각각 다음과 같다.@app.route("/vuln")def vuln(): param = request.args.get("param", "") return param@app.route("/memo")def memo(): global memo_text text = request.args.get("memo", "") memo_text += text + "\n" return render_template("memo.html", memo=memo_text, nonce=nonce)엔드포인트:/flagdef read_url(url, cookie={"name": "name", "value": "value"}): cookie.upda.. 2025년 1학기 C언어 4주차 def solution(n, wires): from collections import deque #자료구조를 불러옴 def bfs(start, graph, visit): #넓이우선 탐색을 한다 queue = deque([start]) visit[start] = True count = 1 # 시작 노드 포함 while queue: node = queue.popleft() #popleft로 맨 앞을 제거하며 반환한다 for n in graph[node]: if not visit[n]: visit[n] = True .. 이전 1 2 3 4 ··· 35 다음 목록 더보기