結果
問題 | No.98 円を描こう |
ユーザー | カルロス |
提出日時 | 2015-08-31 12:54:19 |
言語 | C90 (gcc 11.4.0) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 293 bytes |
コンパイル時間 | 831 ms |
コンパイル使用メモリ | 24,448 KB |
最終ジャッジ日時 | 2024-04-27 04:55:45 |
合計ジャッジ時間 | 1,221 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d %d", &x, &y); | ^~~~~~~~~~~~~~~~~~~~~~ /usr/bin/ld: /tmp/ccqZDKdM.o: in function `main': main.c:(.text.startup+0x1ae): undefined reference to `sqrt' /usr/bin/ld: main.c:(.text.startup+0x1b7): undefined reference to `ceil' /usr/bin/ld: main.c:(.text.startup+0x1d2): undefined reference to `sqrt' /usr/bin/ld: main.c:(.text.startup+0x1d7): undefined reference to `ceil' /usr/bin/ld: main.c:(.text.startup+0x1ec): undefined reference to `sqrt' collect2: error: ld returned 1 exit status
ソースコード
#include <stdio.h> #include <math.h> int main(void){ int x, y; double r; scanf("%d %d", &x, &y); r = ceil(sqrt(x*x + y*y) * 2); if(ceil(sqrt(x*x + y*y))==floor(sqrt(x*x + y*y))){ printf("%d\n", ((int)r) + 1); }else{ printf("%d\n", (int)r); } return 0; }