Programming Language/문제(53)
-
[코드업] 1402 : 거꾸로 출력하기 3
https://codeup.kr/problem.php?id=1402&rid=0 거꾸로 출력하기 3 첫째 줄에 데이터의 개수 n이 입력된다. ( n top = -1; } int isFull(Stack* stack) { return stack->top == MAX_SIZE - 1; } int isEmpty(Stack* stack) { return stack->top == -1; } void push(Stack* stack, int value) { if (isFull(stack)) { return; } stack->data[++stack->top] = value; } int pop(Stack* stack) { if (isEmpty(stack)) { return -1; } return stack->data[st..
2023.06.17 -
[코드업] 3019 : 스케줄 정리
https://codeup.kr/problem.php?id=3019&rid=0 스케줄 정리 5 sleep 2014 05 23 golf 2014 06 02 travel 2015 11 22 baseball 2013 02 01 study 2014 05 23 codeup.kr //버블정렬 사용 #include #include #include typedef struct { int year; int month; int day; char work[100]; } plan; int compare(const plan* a, const plan* b) { if (a->year != b->year) return a->year - b->year; if (a->month != b->month) return a->month - b..
2023.06.17 -
[코드업] 3016 : 1등한 학생의 성적
https://codeup.kr/problem.php?id=3016&rid=0 1등한 학생의 성적 첫 번째 과목을 $1$등한 학생의 이름과 두 번째, 세 번째 과목의 석차를 공백으로 구분하여 출력한다. 단 첫 번째 과목의 $1$등은 $1$명이라고 가정한다. codeup.kr #include #include typedef struct student { int score1; int score2; int score3; char name[10]; } student; int main() { int n; scanf("%d", &n); student* test = (student*)malloc(n * sizeof(student)); for (int i = 0; i < n; i++) { scanf("%s %d %d %..
2023.06.16 -
[코드업] 3015 : 성적표 출력
https://codeup.kr/problem.php?id=3015&rid=0 성적표 출력 첫째 줄에 데이터의 개수 $n$ ($3
2023.06.16 -
[코드업] 1805 : 입체기동장치 생산공장
https://codeup.kr/problem.php?id=1805&rid=0 입체기동장치 생산공장 첫째 줄부터 n번째 줄까지 각 줄에 식별번호를 오름차순으로 정렬해 가스 보유량과 같이 출력한다. codeup.kr #define _CRT_SECURE_NO_WARNINGS #include #include typedef struct device { int number; int gas; }device; int main() { int count; scanf("%d", &count); device* device_count = (device*)malloc(count * sizeof(device)); for (int i = 0; i < count; i++) { scanf("%d %d", &(device_count[i..
2023.06.16