diff --git a/code_study/Baekjoon/c/1018.c b/code_study/Baekjoon/c/1018.c new file mode 100644 index 0000000..83b6585 --- /dev/null +++ b/code_study/Baekjoon/c/1018.c @@ -0,0 +1,41 @@ +#include + +int main() { + char board[51][51]; + int N, M, cnt1, cnt2, min, res=64; + scanf("%d %d",&N,&M); + for(int i=0; icnt2 ? cnt2 : cnt1; + if(min + +int main() { + int N; + scanf("%d",&N); + + char Str[8]; + int n=666, cnt=0; + + while(1) { + sprintf(Str,"%d", n); + for(int i=0; Str[i+2]!='\0'; i++) { + if(Str[i]=='6' && Str[i+1]=='6' && Str[i+2]=='6') { + cnt++; + if(cnt==N) { + printf("%s\n",Str); + return 0; + } + break; + } + } + n++; + } + + return 0; +} \ No newline at end of file diff --git a/code_study/Baekjoon/c/19532.c b/code_study/Baekjoon/c/19532.c new file mode 100644 index 0000000..5bdacdb --- /dev/null +++ b/code_study/Baekjoon/c/19532.c @@ -0,0 +1,31 @@ +#include + +int main() { + int a,b,c,d,e,f,temp,x,y; + scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f); + + for(x=-999; x<1000; x++) { + if(b==0) { + if(a*x != c || e==0) continue; + temp = f - d*x; + if(temp%e==0) { + y = temp / e; + } + else continue; + } + else { + temp = c - a*x; + if(temp%b==0) { + y = temp / b; + } + else continue; + } + + if(d*x+e*y==f){ + printf("%d %d\n", x,y); + return 0; + } + } + + return 0; +} \ No newline at end of file diff --git a/code_study/Baekjoon/c/2231.c b/code_study/Baekjoon/c/2231.c new file mode 100644 index 0000000..ce6245c --- /dev/null +++ b/code_study/Baekjoon/c/2231.c @@ -0,0 +1,31 @@ +#include + +int main() { + int N; + scanf("%d",&N); + + int n=N, cnt=0; + while(n!=0) { + cnt++; + n /=10; + } + + int start = N - 9*cnt < 1 ? 1 : N - 9*cnt; + for(int i=start; i + +int main() { + int N, M, flag=0, sum_temp, result=0; + int arr[100]; + scanf("%d %d",&N, &M); + for(int i=0; i result) { + result = sum_temp; + if(result==M) { + flag = 1; + break; + } + } + } + } + } + } + + printf("%d\n",result); + + return 0; +} \ No newline at end of file diff --git a/code_study/Baekjoon/c/2839.c b/code_study/Baekjoon/c/2839.c new file mode 100644 index 0000000..f99f76e --- /dev/null +++ b/code_study/Baekjoon/c/2839.c @@ -0,0 +1,20 @@ +#include + +int main() { + int N; + scanf("%d",&N); + + int three, five = N/5; + while(five!=-1) { + if( (N-five*5)%3 == 0 ) { + three = (N-five*5)/3; + printf("%d\n",three+five); + return 0; + } + five--; + } + + printf("-1\n"); + + return 0; +} \ No newline at end of file