Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define forn(l, r) for(int i = l; i < (r); ++i)
- #define forj(l, r) for(int j = l; j < (r); ++j)
- #define TAM 1000100
- #define SYNC ios::sync_with_stdio(0);
- #define $ << ' ' <<
- #define F first
- #define S second
- #define endl '\n'
- using namespace std;
- using ll = long long int;
- using ii = pair<int, int>;
- using vii = vector<ii>;
- using vi = vector<int>;
- using graph = vector<vi>;
- const int INF = 0x3f3f3f3f;
- const int MAXN = 112345;
- const ll mod = 1000000007;
- int main() {
- //SYNC
- string s, ans;
- int a, b;
- cin >> s;
- a = 10*(s[0] - 48) + s[1] - 48;
- b = 10*(s[2] - 48) + s[3] - 48;
- if (a > 12) {
- if (b > 12) {
- ans = "NA";
- }else if(b < 1) {
- cout << "NA";
- } else {
- ans = "YYMM";
- }
- }else if(a < 1) {
- if (b > 12) {
- ans = "NA";
- }else if(b < 1) {
- cout << "NA";
- } else {
- ans = "YYMM";
- }
- } else {
- if (b > 12) {
- ans = "MMYY";
- }else if(b < 1) {
- cout << "MMYY";
- } else {
- ans = "AMBIGUOUS";
- }
- }
- cout << ans << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment