제출 #22219

#제출 시각아이디문제언어결과실행 시간메모리
22219a (#42)시간과 날짜 (KRIII5P_1)C++98
7 / 7
16 ms2020 KiB
#include <iostream> #include <stdio.h> using namespace std; bool isTimeRead(int x, int y) { if ((0 <= x&&x <= 23) && (0 <= y&&y <= 59)) return true; return false; } bool isDateRead(int x, int y) { switch (x) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: if (1 <= y&&y <= 31) return true; case 4: case 6: case 9: case 11: if (1 <= y&&y <= 30) return true; case 2: if (1 <= y&&y <= 29) return true; } return false; } int main() { //freopen("input.txt", "r", stdin); //setbuf(stdout, NULL); int testCase; cin >> testCase; for (int t = 1; t <= testCase; t++) { int x, y; cin >> x >> y; cout << (isTimeRead(x, y) ? "Yes " : "No "); cout << (isDateRead(x, y) ? "Yes" : "No") << endl; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...