結果

問題 No.418 ミンミンゼミ
ユーザー a2011404
提出日時 2017-03-15 10:52:05
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 464 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 22,784 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-16 02:18:52
合計ジャッジ時間 948 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:17:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   17 |         scanf("%s", s);
      |         ^~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

#include <string.h>

#include <math.h>



int main() {

	char s[101],a[101]={0},min[]="min";

	int i,j=0,count=0;



	scanf("%s", s);



	for (i = 0; i < strlen(s); i++) {

		if (s[i] != '-') {

			a[j] = s[i];

			j++;
		}

	}


	for(i=0 ; i<=strlen(a)-2 ; i++){
        	for(j=0 ; j<3 ; j++){
            		if(a[i+j] != min[j]){
                	break;
            		}
        	}
		if(j==3)	count++;
	}

	printf("%d\n",count);


	return 0;

}
0