結果
| 問題 | 
                            No.48 ロボットの操縦
                             | 
                    
| コンテスト | |
| ユーザー | 
                             mosmos_21
                         | 
                    
| 提出日時 | 2016-10-05 00:10:07 | 
| 言語 | C90  (gcc 12.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 236 bytes | 
| コンパイル時間 | 517 ms | 
| コンパイル使用メモリ | 20,224 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-21 17:01:26 | 
| 合計ジャッジ時間 | 1,795 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 9 WA * 16 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:4:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    4 |   scanf("%d%d%d", &x, &y, &l);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include <stdio.h>
int main(){
  int x, y, l, k, c=0;
  scanf("%d%d%d", &x, &y, &l);
  c += y < 0 ? 2 : 0;
  x = x>0? x:-x;
  y = y>0? y:-y;
  for(k = 0; k < x;k+=l,c++);
  for(k = 0; k < y;k+=l,c++);
  printf("%d\n", c);
  return 0;
}
            
            
            
        
            
mosmos_21