A题笔记(12)

No.1466  代码:https://code.csdn.net/snippets/192091

No.1202  代码:https://code.csdn.net/snippets/192110

考察点:①判断闰年

 

    if( ((year%4==0) && (year%100!=0)) || (year%400==0) )
        cout<<"366";
    else
        cout<<"365";

 

注意

    int sum, num;
    sum+=num;

这时 sum 必须初始化: sum=0;

 

posted @ 2014-02-17 22:29  阿祖叔叔  阅读(180)  评论(0编辑  收藏  举报