목록공부/코테_문제풀이 (49)
YWC
https://www.acmicpc.net/problem/18110 18110번: solved.ac 5명의 15%는 0.75명으로, 이를 반올림하면 1명이다. 따라서 solved.ac는 가장 높은 난이도 의견과 가장 낮은 난이도 의견을 하나씩 제외하고, {5, 5, 7}에 대한 평균으로 문제 난이도를 결정한다. www.acmicpc.net 1) c #include #include #include #pragma warning(disable:4996) int compare(const int* a, const int* b) { int A = (*(int*)a); int B = (*(int*)b); if (A > B) { return 1; } return -1; } int main(void) { int n = ..
https://www.acmicpc.net/problem/5585 5585번: 거스름돈 타로는 자주 JOI잡화점에서 물건을 산다. JOI잡화점에는 잔돈으로 500엔, 100엔, 50엔, 10엔, 5엔, 1엔이 충분히 있고, 언제나 거스름돈 개수가 가장 적게 잔돈을 준다. 타로가 JOI잡화점에서 물건을 사 www.acmicpc.net 1) c #include #include #pragma warning(disable:4996) int main(void){ int n=0; int result =0; scanf("%d", &n); n = 1000-n; result = result+ (n/500); n = n-((n/500)*500); result = result+ (n/100); n = n-((n/100)*1..
https://www.acmicpc.net/problem/2609 2609번: 최대공약수와 최소공배수 첫째 줄에는 입력으로 주어진 두 수의 최대공약수를, 둘째 줄에는 입력으로 주어진 두 수의 최소 공배수를 출력한다. www.acmicpc.net 1) c #include #include #include #pragma warning(disable:4996) int maxn(int a, int b); int minn(int a, int b); int main(void) { int a, b; a = b = 0; scanf("%d %d", &a, &b); if (a > b) { int t = a; a = b; b = t; } printf("%d\n%d", maxn(a, b), minn(a,b)); return 0..
https://www.acmicpc.net/problem/1546 1546번: 평균 첫째 줄에 시험 본 과목의 개수 N이 주어진다. 이 값은 1000보다 작거나 같다. 둘째 줄에 세준이의 현재 성적이 주어진다. 이 값은 100보다 작거나 같은 음이 아닌 정수이고, 적어도 하나의 값은 0보 www.acmicpc.net 1) c #include #include #pragma warning(disable:4996) int main() { int n, score; scanf("%d", &n); int max = 0; int total = 0; for (int i = 0; i max) { max = sco..