結果
問題 |
No.203 ゴールデン・ウィーク(1)
|
ユーザー |
![]() |
提出日時 | 2018-06-22 13:46:17 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 388 bytes |
コンパイル時間 | 109 ms |
コンパイル使用メモリ | 22,656 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-18 10:27:49 |
合計ジャッジ時間 | 830 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 29 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:7:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%s", C); | ~~~~~^~~~~~~~~ main.cpp:15:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 15 | scanf("%s", C); | ~~~~~^~~~~~~~~
ソースコード
#include<stdio.h> int main(void){ int i; char C[8]; int n = 0, max = 0; scanf("%s", C); for(i = 0; C[i] != '\0'; i++){ if(C[i] == 'o'){ n++; if(max < n) max = n; } else n = 0; } scanf("%s", C); for(i = 0; C[i] != '\0'; i++){ if(C[i] == 'o'){ n++; if(max < n) max = n; } else n = 0; } printf("%d\n", max); return 0; }