请问下这两种写法有什么区别?

if(year%4==0&&year%100!=0||year%400==0)

if(year%4==0)


慕UI6013760
浏览 683回答 0
0回答

慕斯4360584

SBUXROBLVEXIRGSSZSFWGJDGHBEMSVGGJAWQBIYOIPPSRNQRSVFYYIYWGIMKUAKDUKRQDWPYQDSMPEEOTBCJOIVFWERTNXNXKAYFYKVWFDRKLUQHKNBGWWTADIWPICMKNQQXCLWZOBDWCJJZTMGIYIVPZINEQNXBKEEVSLKDDKLCVISIIHIQWGDGAULPOAIVJZANNHVFSCNCMFSZJJPZCTGATDHDDSSVJQNNGWZHWPWMGQHEHBVEHUZGTAHDDSIRYYBPJTGZPMQINOZPQCKTLUOYOPCZJTHBGZTXNBVLXGYJSMJDGQAKCZJGGQKDQQKKTYZFZFRHEQISKVZSJJPVIZIBLGTEVVPMRKWDNCFYSFLNPMTDKLPJJSFYHLVOIGQDQQPPFBYEPBOBBADNKCWXURVDCUZTTTJGDKBSVVGNAKXHUKZDHAYFDQQZNPZCCTRAEORCFYTDTUKHUETPHRBXKDDDGLJPSGDIMFFCTERBHIFVIIEIXJPOOYOBKHYZOHBKHDXHDNCFTGQEKHRKZSBYDEXBSPLDPWTEKJWGTYCCRRRXVQDWTWEAOYYLRLIBHTCPSAHEKRHPYNOBBVBROHZYFKUNXDADQYXAWKYOGMFISRAAGQHAATDZRUBGGNNEEUDKTGPSCPSSYZYIBPVSMYSIOJLSLFZIOYYTCGHLZGSSPSXZLSBYONNDQHUKHIISHXHNDCBZMCCYOOR

慕慕5436299

YSYHAXVSYMTPCNUHETAUEOLBYBYIELWQQVPSWZKIYSTWMCJXAUHZGAEXAPSSGPWAXUDQDTRUDXAEVVYRNARHUYVMNXTQNTPWTNHCGCPDGQDXEHLVSCZGRMMUEDWIFDJQAHLEQNQNBFKUBYMXDZTOOVYRBSHEENBBOVSCFFIJDXBXBIMSSFYSCSVJTHRYOUHIZMWGADRQRPMUSYPDJPGFSWDIJDXBHFFZGHOXHCTPVFCCXUXLBZPOVDRRYLINEJFVLLFISFCPOXEOILIBXNGJYBYSDOLVLYCJMJMMSPVZSJJZCNXTDAHOHWJMHAUUHHELRGNKAIVFWAGXVFZZTRHHEZSVGULCVLJZGWCMGOXVTFPRQMCOEEHYSCFARXIVMWDXGGCCFTAUEXEDATPMGGCVIPFBKIPLBGKLYIYRFMWMWMCEEURAUJMPMNKXZSPPZURKKOAJWTGAPPZMMQTJPKXXHZQDHBXQJADXAPFIEHUXDHROYYYPMSBIZWALIZTGKBEENDAXKWIFTDYZZPMIAUUKKEAADXHGADOAITTHYLHRSSQQBBPROGGRHFSSSWBONQDEBNRPTFSUHRVTEVPMNUNXXYWGHKFPKLYQGUYISCNRBUZQOYZJGHHWMGGXSFWFTATXHXRYJNHCZHBBBZJKEBAXIVVWDJTTXXDYDNHVTTXRMTSANOCWWXEZDOHXIIPSMQRRYMMTNOZDDOZ

浪里小神龙

闰年的判断有两种:第一种是能被4整除而不能被100整除,第二种是能被400整除,注意,第一种是连一起的,所以用&&(与),而||(或)表是另外一种情况,随便满足哪一种都可以得出是闰年的结论第一个明显就是闰年的判断。第二个,判断是不是4的倍数。。。。
打开App,查看更多内容
随时随地看视频慕课网APP