본문 바로가기
반응형
[Roadmap] 컴퓨터 공학 컴퓨터공학 기본기1. C/C++(LTS 기준) 기본 문법- 환경설정(Windows, MacOS, Linux): Visual Studio, GCC- 언어별 특징 및 실행방법: int main(int argc, char** argv)- 코딩컨벤션: camelCase, PascalCase, snake_case, kebap-case, 변수, 함수, 클래스- 변수 및 자료형, 형변환, 상수, primitive type, reference type: char/bool/short/int/long/long long/float/double, const, static- 연산자(산술, 논리, 비교, 비트, 증감, 삼항): +, -, *, /, //, &&, ||, !, ==, !=, , >=, &, |, ~, ++a, a+.. 2025. 2. 7.
[SWEA] D1: 연월일 달력(2056) 해설 문제- 문제 링크: 연월일 달력 풀이(C++)solution 1)- 시간 복잡도: 더보기더보기#include#includeusing namespace std;bool is_valid(string month, string day) { int m = stoi(month); int d = stoi(day); if ((m 12)) return false; if (m == 2) { if ((d 28)) return false; } switch(m) { case 1: case 3: case 5: case 7: case 8: case 10: .. 2025. 1. 31.
[SWEA] D1: 홀수만 더하기(2072) 해설 문제- 문제 링크: 홀수만 더하기 풀이(C++)solution 1)- 시간 복잡도: 더보기더보기#includeusing namespace std;int main(int argc, char** argv){ int test_case; int T; cin>>T; for(test_case = 1; test_case > num; if (num % 2 == 1) sum += num; } cout  (Java)solution 1)- 시간 복잡도: 더보기더보기import java.util.* (Python)solution 1)- 시간 복잡도: 더보기더보기import sysT = int(input())for test_case .. 2025. 1. 31.
[SWEA] D1: 평균값 구하기(2071) 해설 문제- 문제 링크: 평균값 구하기 풀이(C++)solution 1)- 시간 복잡도: 더보기더보기#include#include using namespace std;int main(int argc, char** argv){ int test_case; int T; cin>>T; for(test_case = 1; test_case > num; total += num; } cout  (Java)solution 1)- 시간 복잡도: 더보기더보기import java.util.* (Python)solution 1)- 시간 복잡도: 더보기더보기import sysT = int(input())for test_case in range(1, T + 1): total = .. 2025. 1. 31.
[SWEA] D1: 큰 놈, 작은 놈, 같은 놈(2070) 해설 문제- 문제 링크: 큰 놈, 작은 놈, 같은 놈 풀이(C++)solution 1)- 시간 복잡도: 더보기더보기#includeusing namespace std;int main(int argc, char** argv){ int test_case; int T; cin>>T; for(test_case = 1; test_case > a >> b; if (a > b) cout "  (Java)solution 1)- 시간 복잡도: 더보기더보기import java.util.* (Python)solution 1)- 시간 복잡도: 더보기더보기import sysT = int(input())for test_case in range(1, T + 1): a, b = map.. 2025. 1. 31.
[SWEA] D1: 최대수 구하기(2068) 해설 문제- 문제 링크: 최대수 구하기 풀이(C++)solution 1)- 시간 복잡도: 더보기#includeusing namespace std;int main(int argc, char** argv){ int test_case; int T; cin>>T; for(test_case = 1; test_case > num; if (num > max_val) max_val = num; } cout  (Java)solution 1)- 시간 복잡도: 더보기import java.util.* (Python)solution 1)- 시간 복잡도: 더보기import sysT = int(input())for test_case in range(1, T + .. 2025. 1. 12.
[SWEA] D1: 중간값 찾기(2063) 해설 문제- 문제 링크: 중간값 찾기 풀이(C++)solution 1)- 시간 복잡도: 더보기#include#include using namespace std;int main(int argc, char** argv){ int test_case; int T; int n; cin >> n; int arr[n] = {}; for (int i = 0; i > arr[i]; } sort(arr, arr + n); cout  (Java)solution 1)- 시간 복잡도: 더보기import java.util.* (Python)solution 1)- 시간 복잡도: 더보기import sysT = int(input())arr = list(map(int, input().split().. 2025. 1. 12.
[SWEA] D1: 자릿수 더하기(2058) 해설 문제- 문제 링크: 자릿수 더하기 풀이(C++)solution 1)- 시간 복잡도: 더보기#includeusing namespace std;int main(int argc, char** argv){ int test_case; int T; int n; cin >> n; int sum = 0; while (n > 0) { sum += n % 10; n /= 10; } cout  (Java)solution 1)- 시간 복잡도: 더보기import java.util.* (Python)solution 1)- 시간 복잡도: 더보기import sysnum = int(input())total = 0while num > 0: total += num %.. 2025. 1. 12.
[SWEA] D1: 알파벳을 숫자로 변환(2050) 해설 문제- 문제 링크: 알파벳을 숫자로 변환 풀이(C++)solution 1)- 시간 복잡도: 더보기#include#include using namespace std;int main(int argc, char** argv){ int test_case; int T; string text; cin >> text; for (int i = 0; i  (Java)solution 1)- 시간 복잡도: 더보기import java.util.* (Python)solution 1)- 시간 복잡도: 더보기import systext = input()for i in text: print(ord(i) -64, end=" ") 2025. 1. 12.
[SWEA] D1: 신문 헤드라인(2047) 해설 문제- 문제 링크: 신문 헤드라인 풀이(C++)solution 1)- 시간 복잡도: 더보기#include#include using namespace std;int main(int argc, char** argv){ int test_case; int T; string str; cin >> str; for (int i = 0; i = 'a') && (str[i]  (Java)solution 1)- 시간 복잡도: 더보기import java.util.* (Python)solution 1)- 시간 복잡도: 더보기import systext = input()text = text.upper()print(text) 2025. 1. 12.
반응형