結果
| 問題 |
No.436 ccw
|
| ユーザー |
nninjinn00
|
| 提出日時 | 2016-11-08 18:58:14 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 284 bytes |
| コンパイル時間 | 848 ms |
| コンパイル使用メモリ | 20,736 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-25 05:16:23 |
| 合計ジャッジ時間 | 1,510 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 24 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%s", s);
| ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
int main(void){
int i;
int c = 0;
int w = 0;
char s[100000];
scanf("%s", s);
int l = strlen(s);
for(i=0; i<l; i++);{
if(s[i] == 'c') c++;
else w++;
}
if(c - 1 > w)
printf("%d\n", w);
else
printf("%d\n", c-1);
return 0;
}
nninjinn00