結果

問題 No.104 国道
ユーザー Maeda
提出日時 2025-03-07 16:59:37
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 270 bytes
コンパイル時間 314 ms
コンパイル使用メモリ 24,448 KB
実行使用メモリ 8,608 KB
最終ジャッジ日時 2025-03-07 16:59:38
合計ジャッジ時間 1,275 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 4
other AC * 3 WA * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:28: warning: comparison between pointer and integer
    9 |                 if(bendStr == 'L'){
      |                            ^~
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         scanf("%s",bendStr);
      |         ^~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

void main(void){
	char bendStr[100] = "a";
	scanf("%s",bendStr);
	int i = 0;
	int nowLane = 1;
	while(bendStr[i] != '\0'){
		if(bendStr == 'L'){
			nowLane = nowLane * 2;
		}else{
			nowLane = nowLane * 2 + 1;
		}
		i++;
	}
	
	printf("%d",nowLane);
}
0