結果
| 問題 | 
                            No.104 国道
                             | 
                    
| コンテスト | |
| ユーザー | 
                             yamaken1343
                         | 
                    
| 提出日時 | 2015-11-20 22:04:26 | 
| 言語 | C90  (gcc 12.3.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 227 bytes | 
| コンパイル時間 | 99 ms | 
| コンパイル使用メモリ | 20,608 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-13 17:05:38 | 
| 合計ジャッジ時間 | 850 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 16 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%s",s);
      |         ^~~~~~~~~~~~~
            
            ソースコード
#include<stdio.h>
int main(void){
	int a,b,c;
	char s[31];
	
	scanf("%s",s);
	b=1;
	a=0;
	while(s[a] != '\0'){
		if(s[a] == 'L') b = 2*b;
		else if(s[a] == 'R')b = 2*b +1;
		else break;
		a++;
	}
	printf("%d\n",b);
	return 0;
}
            
            
            
        
            
yamaken1343