K

@kimjuha19

미로의 최단 경로 구하기

Python
5 months ago
from collections import deque n, m = map(int, input().split()) graph = [] for i in range(n): graph.append(list(map(int, input().strip()))) dx = [-1, 1, 0, 0] dy = [0, 0, -1, 1]

주차 요금 계산기

Python
5 months ago
class Parking: def __init__(self, minutes): self.minutes = minutes def calculate_fee(self): base_time = 30 base_fee = 2000 extra_fee_per_10 = 500 if self.minutes <= base_time:

소수 판별기

Python
5 months ago
class PrimeChecker: def __init__(self, number): self.number = number def is_prime(self): if self.number < 2: return False for i in range(2, self.number): if self.number % i == 0:

단어 필터링

Python
5 months ago
class Filter: def __init__(self, word="바보"): self.word = word def check(self, sentence): if self.word in sentence: print("순화된 언어를 사용하세요") else: print("정상 입력")

별 찍기 클래스

C++
5 months ago
#include <iostream> using namespace std; class Star { private: int n; public: Star(int num) : n(num) {} void printStar() {

BMI 계산기

C++
5 months ago
#include <iostream> using namespace std; class BMI { private: double weight, height, bmi; public: BMI(double w, double h) : weight(w), height(h / 100), bmi(0) {} void calculate() { bmi = weight / (height * height); }

할인 시스템

C++
5 months ago
#include <iostream> using namespace std; class Shop { private: int price; int quantity; public: Shop(int p, int q) : price(p), quantity(q) {}

학점 변환기

C++
5 months ago
#include <iostream> using namespace std; class Grade { private: int scores[100]; char grades[100]; int n; public: Grade(int s[100], int count) {

업다운 게임

C++
5 months ago
#include <iostream> #include <cstdlib> #include <ctime> using namespace std; class UpDownGame { private: int answer; public: UpDownGame() {

최대값 찾기

C++
5 months ago
#include <iostream> using namespace std; class MaxFinder { private: int numbers[5]; public: MaxFinder(int nums[5]) { for (int i = 0; i < 5; i++) numbers[i] = nums[i];

최대값 찾기

Python
5 months ago
class MaxFinder: def __init__(self, numbers): self.numbers = numbers def find_max(self): max_val = self.numbers[0] for num in self.numbers: if num > max_val: max_val = num return m

은행 계좌 시스템

Python
5 months ago
#include <iostream> using namespace std; class Account { private: double balance; public: Account(double init_balance) { balance = init_balance;

별 찍기 클래스

Python
5 months ago
class Star: def __init__(self, n): self.n = n def print_star(self): for i in range(1, self.n + 1): for j in range(self.n - i): print(" ", end="") for k in range(2 * i - 1):

비만도(BMI) 계산기

Python
5 months ago
class BMI: def __init__(self, weight, height): self.weight = weight self.height = height / 100 self.total = 0 def calculate(self): self.total = self.weight / (self.height ** 2) return self.total

할인 시스템

Python
5 months ago
class Shop: def __init__(self, price): self.price = price def calculate(self): if self.price <= 100000: self.price = self.price * 80 // 100 elif self.price >= 50000 and self.price >= 100000:

학점 변환기

Python
5 months ago
class Grade: def __init__(self, scores): self.scores = scores self.grades = [] def make_grades(self): for s in self.scores: if s >= 90: self.grades.append('A') elif s >= 80:

최대값 찾기

Python
5 months ago
class Big: def __init__(self, numbers): self.numbers = numbers def biggest(self): big = self.numbers[0] for n in self.numbers: if n > big: big = n return big

자릿수 뒤집기 클래스

C++
5 months ago
#include <iostream> using namespace std; class NumberReverse { public: int reverseNumber(int num) { int reversed = 0; while (num > 0) { reversed = reversed * 10 + (num % 10);

자릿수 뒤집기

Python
5 months ago
#include <iostream> using namespace std; class NumberReverse { public: int reverseNumber(int num) { int reversed = 0; while (num > 0) { reversed = reversed * 10 + (num % 10);

카운터

C++
5 months ago
#include <iostream> using namespace std; class Counter { private: static int count; public: Counter() { count++;