From bfb233b4a3700b746b8f48ee41e97d3828b811ea Mon Sep 17 00:00:00 2001 From: songyc macbook Date: Mon, 9 Jun 2025 21:47:13 +0900 Subject: [PATCH] 20250609 baekjoon C --- code_study/Baekjoon/c/1193.c | 26 ++++++++++++++++++++++++++ code_study/Baekjoon/c/2292.c | 18 ++++++++++++++++++ code_study/Baekjoon/c/2720.c | 18 ++++++++++++++++++ code_study/Baekjoon/c/2869.c | 13 +++++++++++++ code_study/Baekjoon/c/2903.c | 9 +++++++++ 5 files changed, 84 insertions(+) create mode 100644 code_study/Baekjoon/c/1193.c create mode 100644 code_study/Baekjoon/c/2292.c create mode 100644 code_study/Baekjoon/c/2720.c create mode 100644 code_study/Baekjoon/c/2869.c create mode 100644 code_study/Baekjoon/c/2903.c diff --git a/code_study/Baekjoon/c/1193.c b/code_study/Baekjoon/c/1193.c new file mode 100644 index 0000000..35bb083 --- /dev/null +++ b/code_study/Baekjoon/c/1193.c @@ -0,0 +1,26 @@ +#include + +int main(){ + int X; + scanf("%d",&X); + + int line=1, line_max=1, denum; + do{ + if(X>line_max){ + line_max+=line+1; + } + else{ + if(line%2){ + denum = line-(line_max-X); + } + else{ + denum = line_max-X+1; + } + printf("%d/%d",line-denum+1, denum); + break; + } + }while(line++); + + return 0; + +} \ No newline at end of file diff --git a/code_study/Baekjoon/c/2292.c b/code_study/Baekjoon/c/2292.c new file mode 100644 index 0000000..62495ac --- /dev/null +++ b/code_study/Baekjoon/c/2292.c @@ -0,0 +1,18 @@ +#include + +int main(){ + int N, res=0, max_value=1; + scanf("%d",&N); + + while(++res){ + if(max_value + +int main(){ + int t, c; + int coin[4] = {25,10,5,1}; + scanf("%d",&t); + + while(t--){ + scanf("%d",&c); + for(int i=0; i<4; i++){ + printf("%d ",c/coin[i]); + c%=coin[i]; + } + printf("\n"); + } + + return 0; +} \ No newline at end of file diff --git a/code_study/Baekjoon/c/2869.c b/code_study/Baekjoon/c/2869.c new file mode 100644 index 0000000..09724eb --- /dev/null +++ b/code_study/Baekjoon/c/2869.c @@ -0,0 +1,13 @@ +#include + +int main(){ + int a,b,v,days; + scanf("%d %d %d",&a,&b,&v); + + days = (v-a)/(a-b) + 1; + if((v-a)%(a-b)!=0) days++; + + printf("%d",days); + + return 0; +} \ No newline at end of file diff --git a/code_study/Baekjoon/c/2903.c b/code_study/Baekjoon/c/2903.c new file mode 100644 index 0000000..85ea26f --- /dev/null +++ b/code_study/Baekjoon/c/2903.c @@ -0,0 +1,9 @@ +#include + +int main(){ + int N; + scanf("%d",&N); + printf("%d",((1<