結果
| 問題 | No.436 ccw |
| コンテスト | |
| ユーザー |
tj_0612
|
| 提出日時 | 2016-11-18 01:05:18 |
| 言語 | C90(gcc12) (gcc 12.4.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 302 bytes |
| 記録 | |
| コンパイル時間 | 154 ms |
| コンパイル使用メモリ | 28,968 KB |
| 最終ジャッジ日時 | 2026-02-23 22:54:40 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 24 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%s",S);
| ^~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(){
char S[100001];
scanf("%s",S);
int count_c,count_w;
int i = 0;
while(1){
if(S[i]=='\0')
break;
else if(S[i]=='c')
count_c++;
else
count_w++;
i++;
}
if(count_w >= count_c)
printf("%d\n", count_c-1);
else
printf("%d\n", count_w);
return 0;
}
tj_0612