結果
問題 |
No.920 あかあお
|
ユーザー |
![]() |
提出日時 | 2021-05-02 14:08:36 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 350 bytes |
コンパイル時間 | 760 ms |
コンパイル使用メモリ | 20,736 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-20 22:57:47 |
合計ジャッジ時間 | 1,399 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 |
コンパイルメッセージ
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("%d%d%d", &x, &y, &z); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <stdlib.h> int main(void) { int x, y, z; scanf("%d%d%d", &x, &y, &z); if(z >= abs(x - y)){ if(x > y){ printf("%d\n", (z - abs(x - y)) / 2 + x); } else{ printf("%d\n", (z - abs(x - y)) / 2 + y); } } else{ if(x > y){ printf("%d\n", y + z); } else{ printf("%d\n", x + z); } } return 0; }