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