結果
| 問題 |
No.418 ミンミンゼミ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-09-15 19:39:13 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 256 bytes |
| コンパイル時間 | 305 ms |
| コンパイル使用メモリ | 20,224 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-16 01:23:42 |
| 合計ジャッジ時間 | 1,167 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 25 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%s",str);
| ^~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>/*セミの鳴き声カウント*/
int main(void){
int cnt=0,i=0;
char str[101];
scanf("%s",str);
while(str[i] != '\0'){
if(str[i] == 'm'){
while(str[i] != 'n') i++;
cnt++;
}
i++;
}
printf("%d\n",cnt);
return 0;
}