結果
問題 | No.113 宝探し |
ユーザー | suppy193 |
提出日時 | 2015-05-28 14:03:24 |
言語 | C90 (gcc 11.4.0) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 391 bytes |
コンパイル時間 | 133 ms |
コンパイル使用メモリ | 23,936 KB |
最終ジャッジ日時 | 2024-04-28 07:24:59 |
合計ジャッジ時間 | 496 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%s", s); | ^~~~~~~~~~~~~~ /usr/bin/ld: /tmp/cc8oBrUx.o: in function `main': main.c:(.text.startup+0xef): undefined reference to `sqrt' collect2: error: ld returned 1 exit status
ソースコード
#include <stdio.h> #include <math.h> int main(void) { int i, x = 0, y = 0; char s[101]; scanf("%s", s); //printf("%s\n", s); i = 0; while(s[i] != '\0'){ switch(s[i]){ case 'N': x--; break; case 'S': x++; break; case 'E': y++; break; case 'W': y--; break; } i++; } //printf("%d %d\n", x, y); printf("%f\n", sqrt(x * x + y * y)); return 0; }