結果
問題 | No.436 ccw |
ユーザー |
|
提出日時 | 2016-11-15 23:14:28 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 232 bytes |
コンパイル時間 | 390 ms |
コンパイル使用メモリ | 54,668 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 01:56:02 |
合計ジャッジ時間 | 1,267 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:10:24: warning: NULL used in arithmetic [-Wpointer-arith] 10 | for(int i=0;letter[i]!=NULL;i++){ | ^~~~
ソースコード
#include "iostream" using namespace std; char letter[100001]; int c; int w; int main(){ cin >>letter; for(int i=0;letter[i]!=NULL;i++){ if(letter[i]=='c')c++; else w++; } if(c-1>w)cout <<w; else cout <<c-1; cout<<"\n"; return 0; }