K

@kimjuha19

게시물 좋아요 시스템

Python
5 months ago
class Post: def __init__(self, name, likes): self.name = name self.likes = likes def like(self): self.likes += 1 def dislike(self): self.likes -= 1

전기차 주행 시스템

Python
5 months ago
class ElectricCar: def __init__(self, name,battery): self.name = name self.battery = 100 def drive(self,dist): self.dist = dist for i in range(1,self.dist): self.battery -= 1 if self.b

장바구니 합계 계산기

Python
5 months ago
class ShoppingCart: def __init__(self): self.items = [] def add_item(self, price): self.items.append(price) def get_total(self): self.items = sum(self.items) * 0.9

스마트 조명 제어

Python
5 months ago
class SmartLight: def __init__(self, name, bright): self.name = name self.set_brightness(bright) def set_brightness(self, value): if value < 0: self.bright = 0 elif value > 100: self.b

도서관 대출 관리

Python
5 months ago
class Book: def __init__(self, name, is_borrowed): self.name = name self.is_borrowed = False def borrow(self): if self.is_borrowed == True: print("이미 대출 중입니다") else: self.is_borrowed =

만보기 칼로리 계산기

Python
5 months ago
class StepCounter: def __init__(self, name): self.name = name self.steps = 0 def walk(self, s): self.steps += s def get_calories(self): return self.steps * 0.04

무인 카페 키오스크 시스템

Python
5 months ago
class CoffeeMachine: def __init__(self, machine): self.machine = machine self.bean = 100 def make_coffee(self, amount): if self.bean < amount: print("원두가 부족합니다") else: self.bean -= amo

영화관 좌석 예약

Python
5 months ago
person = [2, 3, 1] total = 0 K = 3 for i in range(len(person)): total += person[i] total = total // K print(total)

주차장 요금계산

Python
5 months ago
time = [[13, 0], [14, 25]] start = time[0][0] * 60 + time[0][1] end = time[1][0] * 60 + time[1][1] use = end - start money = 1000 if use > 30:

버스 배차 시간

Python
5 months ago
start_time = 9 a = 8 b = 12 ans = 0 for i in range(max(a,b),(a*b)+1): if i % a == 0 and i % b == 0: ans = i break

카드 뒤집기

Python
5 months ago
num = [1,2,3,4,5,6,7,8,9,10] index = [3,7] start = index[0] - 1 end = index[1] - 1 while start < end: num[start], num[end] = num[end], num[start] start += 1 end -= 1

로봇 청소기

Python
5 months ago
road = "RRLLRRRLLR" start = 0 for i in range(len(road)): if road[i] == "R": start += 1 elif road[i] == "L": start -= 1 print(start)

369 게임

Python
5 months ago
N = 15 count = 0 for i in range(1, N + 1): current = i while current != 0: if current % 10 == 3 or current % 10 == 6 or current % 10 == 9: count += 1 current = current // 10

소수(Prime Number) 판별

Python
5 months ago
N = 17 is_prime = True if N <= 1: is_prime = False else: i = 2 while i * i <= N: if N % i == 0: is_prime = False

계단 오르기

Python
5 months ago
n = 4 if n <= 2: print(n) dp = [0] * (n + 1) dp[1] = 1 dp[2] = 2 for i in range(3, n + 1):

학급 평균과 우수생

Python
5 months ago
scores = [85, 90, 70, 60, 100] num = sum(scores) / len(scores) count = 0 for i in scores: if i > num: count += 1 print(count)

실시간 평균값 계산기

C++
5 months ago
#include <iostream> #include <vector> using namespace std; class Averager { public: vector<int> numbers; void add(int num) { numbers.push_back(num);

농구 점수판

C++
5 months ago
#include <iostream> #include <string> using namespace std; class ScoreBoard { public: string team; int score; ScoreBoard(string t) : team(t), score(0) {}

티켓 예매 시스템

C++
5 months ago
#include <iostream> #include <string> using namespace std; class Cinema { public: string title; int seats; Cinema(string t, int s) : title(t), seats(s) {}

가전제품 전력 관리

C++
5 months ago
#include <iostream> #include <string> using namespace std; class Appliance { public: string name; int power; Appliance(string n, int p) : name(n), power(p) {}