結果

問題 No.436 ccw
ユーザー ichiruisyu
提出日時 2016-11-02 15:23:38
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 309 bytes
コンパイル時間 414 ms
コンパイル使用メモリ 22,528 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-25 01:29:43
合計ジャッジ時間 1,504 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 3 WA * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |                 scanf("%c",&S[i]);
      |                 ~~~~~^~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>


int main()
{
	int i, c_count, w_count;
	char S[100003];
	
	for(i=0; ;i++){
		scanf("%c",&S[i]);
		if(S[i] == 'w')
			c_count = i;
		if(S[i] == '\0'){
			w_count = i-c_count;
			break;
		}
	}
	
	if(c_count+1 > w_count)
		printf("%d",w_count);
	else
		printf("%d",c_count);
		
	return 0;
}
0