結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー mosmos_21
提出日時 2016-10-14 00:00:42
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 286 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 20,864 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-18 09:53:54
合計ジャッジ時間 1,005 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |   scanf("%s%s", a, b);
      |   ^~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <string.h>

int main(){
  char a[15], b[8];
  int S = 0, s = 0, i;
  scanf("%s%s", a, b);
  strcat(a, b);

  for(i = 0; i < 15; i++){
    if(a[i] == 'o'){
      s++;
    }else{
      if(s > S) S = s;
      s = 0;
    }
  }
  printf("%d\n", S);
  return 0;
}
0