intmain(){ int n; cin >> n; cout << "license number owner's name" << endl; for (int i = 0; i < n; i++) { string a, b, c; int x; cin >> a >> b >> c >> x; if (x > 5) { continue; } bool waidi = (a.substr(0, 6) == "cityB.");
if (!waidi) { cout << a << " " << b << endl; } else { char y = '\0'; for (int j = a.size() - 1; j >= 0; j--) { if (isdigit(a[j])) { y = a[j]; break; } } bool ans = false; switch (x) { case1: if (y == '1' || y == '9') ans = true; break; case2: if (y == '2' || y == '8') ans = true; break; case3: if (y == '3' || y == '7') ans = true; break; case4: if (y == '4' || y == '6') ans = true; break; case5: if (y == '5' || y == '0') ans = true; break; }