Submission #944514

#TimeUsernameProblemLanguageResultExecution timeMemory
944514rainboy제곱근 구하기 1 (gs13068_sqrt1)C11
Compilation error
0 ms0 KiB
#include <math.h> #include <stdio.h> int main() { long long n; int r; scanf("%lld", &n), r = sqrt(n); while ((long long) (r + 1) * (r + 1) <= n) r++; while ((long long) r * r > n) r--; printf("%f\n", r + (double) (n - (long long) r * r) / (r * 2 + 1)); return 0; }

Compilation message (stderr)

sqrt1.c: In function 'main':
sqrt1.c:8:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |  scanf("%lld", &n), r = sqrt(n);
      |  ^~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccQw6w8u.o: in function `main':
sqrt1.c:(.text.startup+0xe9): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status