From 39974d5f7401685b0ea2f3d635f8ba8dd7ac592d Mon Sep 17 00:00:00 2001 From: hihiboss Date: Wed, 3 Apr 2019 22:42:03 +0900 Subject: [PATCH 1/2] Solve baekjoon no.2869 by Junhui Kim --- ...0\352\263\240\354\213\266\353\213\244.cpp" | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 "junhuikim/2869-\353\213\254\355\214\275\354\235\264\353\212\224\354\230\254\353\235\274\352\260\200\352\263\240\354\213\266\353\213\244.cpp" diff --git "a/junhuikim/2869-\353\213\254\355\214\275\354\235\264\353\212\224\354\230\254\353\235\274\352\260\200\352\263\240\354\213\266\353\213\244.cpp" "b/junhuikim/2869-\353\213\254\355\214\275\354\235\264\353\212\224\354\230\254\353\235\274\352\260\200\352\263\240\354\213\266\353\213\244.cpp" new file mode 100644 index 0000000..7a1cca6 --- /dev/null +++ "b/junhuikim/2869-\353\213\254\355\214\275\354\235\264\353\212\224\354\230\254\353\235\274\352\260\200\352\263\240\354\213\266\353\213\244.cpp" @@ -0,0 +1,25 @@ +#include +#include +#include + +using namespace std; + +int main(void) { + int A, B, V; + + scanf("%d %d %d", &A, &B, &V); + + int todo = V-A; + int dV = A-B; + + int day = 1; + + if(todo % dV == 0) { + day += todo/dV; + } else { + day += todo/dV + 1; + + } + + printf("%d", day); +} \ No newline at end of file From 54cdf5fc18567ff152eba8a927189003590a5bb6 Mon Sep 17 00:00:00 2001 From: hihiboss Date: Fri, 5 Apr 2019 16:29:47 +0900 Subject: [PATCH 2/2] Solve issue #25 by Junhui Kim --- junhuikim/rootN.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 junhuikim/rootN.cpp diff --git a/junhuikim/rootN.cpp b/junhuikim/rootN.cpp new file mode 100644 index 0000000..6ed6d3e --- /dev/null +++ b/junhuikim/rootN.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +using namespace std; + +// This calculates root N. +// After starting this program, put the N you want. +int main(void) { + double N; + + double start, mid, end; + + double result; + + scanf("%lf", &N); + + start = 0; + end = N; + + mid = (start + end) / 2; + + for (int i = 0; i < 100; i++) { + result = mid * mid; + + if (result == N) { + break; + } + + if (result > N) { + end = mid; + } + + if (result < N) { + start = mid; + } + + mid = (start + end) / 2; + } + + printf("%lf", mid); + return 0; +} \ No newline at end of file