foo.cc: In function ‘int main()’:
foo.cc:7:19: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
7 | for(y%4==0&&y%100!=0||y%400==0)
| ~~~~~~^~~~~~~~~~
foo.cc:7:39: error: expected ‘;’ before ‘)’ token
7 | for(y%4==0&&y%100!=0||y%400==0)
| ^
| ;
foo.cc:7:29: warning: statement has no effect [-Wunused-value]
7 | for(y%4==0&&y%100!=0||y%400==0)
| ~~~~~~~~~~~~~~~~^~~~~~~~~~
foo.cc:9:9: error: expected primary-expression before ‘switch’
9 | switch(m)
| ^~~~~~
foo.cc:8:24: error: expected ‘;’ before ‘switch’
8 | leap=1;
| ^
| ;
9 | switch(m)
| ~~~~~~
foo.cc:9:9: error: expected primary-expression before ‘switch’
9 | switch(m)
| ^~~~~~
foo.cc:8:24: error: expected ‘)’ before ‘switch’
8 | leap=1;
| ^
| )
9 | switch(m)
| ~~~~~~
foo.cc:7:12: note: to match this ‘(’
7 | for(y%4==0&&y%100!=0||y%400==0)
| ^