結果

問題 No.746 7の倍数
ユーザー antyobiantyobi
提出日時 2019-04-18 22:13:10
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 313 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 23,680 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-22 10:45:52
合計ジャッジ時間 45,182 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2 TLE * 1
other TLE * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |     scanf("%d",&N);
      |     ~~~~~^~~~~~~~~

ソースコード

diff #

#include <stdio.h>
int rui(int n){
    if(n==1) return(10);
    else if(n==0) return(1);
    else return(10*rui(n-1));
}

int main(){
    int i,N,M,z;
    double x,j=0;
    scanf("%d",&N);
    M=rui(N);
    for(i=1;i<=M;i++){
        z=i%7;
        if(z==0) j++;
    }
    x=(double)(j/M);
    printf("%lf",x);
}
0