結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー yycoder
提出日時 2019-12-08 22:48:54
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 176 bytes
コンパイル時間 586 ms
コンパイル使用メモリ 24,320 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-01-02 17:05:13
合計ジャッジ時間 1,355 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%d", &n);
      |         ^~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>

int main()
{
	int n;
	int count = 0;
	int total = 1;
	scanf("%d", &n);
	while (total < n) {
		total *= 2;
		count++;
	}
	printf("%d\n", count);

	return 0;
}
0