結果
| 問題 |
No.418 ミンミンゼミ
|
| コンテスト | |
| ユーザー |
notetonous
|
| 提出日時 | 2016-09-10 00:06:19 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 247 bytes |
| コンパイル時間 | 174 ms |
| コンパイル使用メモリ | 20,864 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-16 01:18:11 |
| 合計ジャッジ時間 | 939 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 25 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%s",s);
| ^~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
int main(){
char s[100];
scanf("%s",s);
int a=0,i,ans=0;
for(i=0;i<strlen(s);i++){
if(s[i]=='m')a=1;
else if(a==1 && s[i]=='n'){
ans++;a=0;
}
}
printf("%d\n",ans);
return 0;
}
notetonous