I am new in programming and I need a little help at a problem in C++ .
The problem is :
I need to read 3 numbers and to determinate if this numbers can be a date or not . I need to say
"YES"
if the numbers can be a date or"NOT"
if they can`t be a date.
I've tried this :
#include <iostream>
using namespace std;
int main(){
unsigned int z, l, a;
cin >> z >> l >> a;
if((z<32 && l==1) || (z==29 && l==2 && a%4==0) ||
(z<29 && l==2 && a%4>0) ||(z<32 && l==3) ||
(z<31 && l==4) || (z<32 && l==5) || (z<31 && l==6) ||
(z<32 && l==7) || (z<31 && l==8) || (z<32 && l==9) ||
(z<31 && l==10) || (z<31 && l==1) || (z<31 && l==12)) cout << "YES";
else cout << "NO";
return 0;
}
Question:
Could you help me find the missed cases?
Note:
My teacher commented that "It is almost done but you miss some cases". I tried to find this cases 2 hours but I didn't succeed ...