結果

問題 No.46 はじめのn歩
コンテスト
ユーザー cnyanko1
提出日時 2017-11-23 16:20:36
言語 C90
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 243 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 157 ms
コンパイル使用メモリ 37,228 KB
最終ジャッジ日時 2026-02-24 00:51:44
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'main':
main.c:16:10: warning: passing argument 1 of 'puts' from incompatible pointer type [-Wincompatible-pointer-types]
   16 |     puts(&d);
      |          ^~
      |          |
      |          int *
In file included from main.c:1:
/usr/include/stdio.h:714:30: note: expected 'const char *' but argument is of type 'int *'
  714 | extern int puts (const char *__s);
      |                  ~~~~~~~~~~~~^~~

ソースコード

diff #
raw source code

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>

int main(void){

    int a,b,c,d;
    scanf("%d %d",&a,&b);
    c=b%a;
    if(c==0){
        d=c;
    }else{
        d=c+1;
    }
    puts(&d);

    return 0;
}
        
0