提交时间:2026-05-04 11:56:29

运行 ID: 439019

#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int pre = (s[0] - '0') * 10 + (s[1] - '0'); int suf = (s[2] - '0') * 10 + (s[3] - '0'); bool A = (suf >= 1 && suf <= 12); bool B = (pre >= 1 && pre <= 12); if(A && B) cout << "AMBIGUOUS" << endl; else if(A) cout << "YYMM" << endl; else if(B) cout << "MMYY" << endl; else cout << "NA" << endl; return 0; }