結果
問題 | No.418 ミンミンゼミ |
ユーザー | moyashi_senpai |
提出日時 | 2016-09-09 22:25:45 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 773 bytes |
コンパイル時間 | 779 ms |
コンパイル使用メモリ | 77,308 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-16 01:14:37 |
合計ジャッジ時間 | 1,393 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:24:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 24 | scanf("%s", s); | ~~~~~^~~~~~~~~
ソースコード
#include <iostream> #include <cstdio> #include <vector> #include <cmath> #include <cstring> #include <numeric> #include <algorithm> #include <functional> #include <array> #include <map> #include <queue> #include <limits.h> #include <set> #include <stack> #define REP(i,n) for(int i = 0; n > i; i++) #define MOD 1000000007 using namespace std; typedef vector<int> Ivec; typedef pair<int, int> pii; typedef long long int ll; int main() { char s [101]; scanf("%s", s); int count = 0; int state = 0; for (int i = 0; strlen(s) > i; i++) { if (s[i] == 'm' && s[i + 1] == 'i') { i += 2; for (; strlen(s) > i; i++) { if (s[i] == '-') continue; if (s[i] == 'n') { count++; break; } else break; } } } printf("%d\n", count); return 0; }