top1编程
← 返回题目
题解

【基础】闰年判断

3 条题解

  • 0
    @ 2026-7-29 20:24:11
    #include<bits/stdc++.h>
    using namespace std;
    
    int main(){
    	int n;
    	cin >> n;
    	if (n % 4 == 0 && n % 100 != 0 || n % 400 == 0) {
    		cout << "yes";
    	}else {
    		cout << "no";
    	}
        
    	return 0;	
    }
    
    • 0
      @ 2026-7-29 0:06:23
      #include<bits/stdc++.h>
      using namespace std;
      
      int main(){
      	int n;
      	cin >> n;
      	if (n % 4 == 0 && n % 100 != 0 || n % 400 == 0) {
      		cout << "yes";
      	}else {
      		cout << "no";
      	}
          
      	return 0;	
      }
      
      • 0
        @ 2026-7-28 22:09:44
        #include<bits/stdc++.h>
        using namespace std;
        int main(){
        	int n;
        	cin>>n;
        	if(n%4==0&&n%100!=0||n%400==0){
        		cout<<"yes";
        	}
        	else{
        		cout<<"no";
        	}
        	return 0;
        }
        
        • 1