28 条题解

  • 3
    @ 2022-1-2 14:45:36
    #include <stdio.h>
    #include <iostream>
    #include <math.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin >>n;
    	if(n%4==0 && n%100 !=0)
    	{
    		cout <<"Y";
    	}
    	else if(n%400 == 0)
    	{
    		cout <<"Y";
    	}
    	else
    	{
    		cout <<"N";
    	}
    }
    
    • 2
      @ 2023-1-26 16:15:10

      为什么非要那么多判断呢?

      #include<iostream>
      using namespace std;
      int main(){
      	int a;
      	cin>>a;
      	if(a%4==0&&a%100!=0||a%400==0){
      		cout<<"Y";
      	}else{
      		cout<<"N";
      	}
      	return 0;
      }
      
      • 1
        @ 2025-12-14 20:06:58
        #include<iostream>
        #include<cstdio>
        #include<cctype>
        #include<string.h>
        #include<math.h>
        #include<cmath>
        #include<algorithm>
        #include<iomanip>
        using namespace std;
        int main()
        {
        	int a;
        	cin>>a;
        	if((a%4==0&&a%100!=0)||a%400==0)
        	{
        		cout<<"Y";	
        	} 
        	else
        	{
        		cout<<"N";
        	}
        	return 0;
        }
        
        
        
        • 0
          @ 2025-7-9 16:47:15

          //以下为答案 #include #include #include using namespace std; int main() {

          int a;
          cin>>a;
          if(a % 4 == 0 && a % 100 != 0|| a % 400 == 0)
          {
          	cout<<"Y";
          }
          else
          {
          	cout<<"N";
          }
          return 0;
          

          }

          • 0
            @ 2024-6-15 19:56:39

            #include using namespace std; int main() { int a; cin >> a; cout << a % 10; return 0;

            • 0
              @ 2024-5-19 15:13:11

              #include using namespace std; const int N = 1e6 + 10; const int INF = 0x3f3f3f3f; int main() { int a; cin >> a; if( a / 100 != 0 && a / 4 == 0 ) { cout << "Y"; } else { cout << "N"; } return 0; }

              • 0
                @ 2024-4-5 20:19:17

                #include #include using namespace std; int main() { int a; cin >> a; if(a % 4 == 0) { cout<<"Y"; } else { cout<<"N"; }

                return 0;
                

                }

                • 0
                  @ 2023-6-25 14:40:29
                  #include <iostream>
                  #include <stdio.h>
                  #include <iomanip>
                  #include <math.h>
                  using namespace std;
                  const int N = 1e6 + 10;
                  const int INF = 0x3f3f3f3f;
                  int main()
                  {
                  	int a;
                  	cin >> a;
                  	if( a / 100 != 0 && a / 4 == 0 )
                  	{
                  		cout << "Y";
                  	}
                  	else
                  	{
                  		cout << "N";
                  	}
                  	return 0;
                  }
                  
                  • 0
                    @ 2023-5-23 20:11:56

                    #include #include #include #include #include #include #include using namespace std; const int INF = 0x3f3f3f3f; int a; int main() { cin >> a; if (a % 4 == 0) { cout << "Y"; } else { cout << "N"; } return 0; }

                    • 0
                      @ 2023-5-7 11:41:55

                      #include using namespace std; int main() { int a; char c; cin>>a; if(a%40&&a%100!=0&&a%4000) { cout<<"Y"; } else { cout<<"N"; } return 0; }

                      • -1
                        @ 2025-3-26 17:46:41

                        #include <bits/stdc++.h>

                        using namespace std;

                        int main() { int a;

                        cin >> a;
                        
                        if (a % 4 == 0 && a % 100 != 0)
                        {
                            cout << "Y";
                        }
                        else if (a % 400 == 0)
                        {
                            cout << "Y";
                        }
                        else
                        {
                            cout << "N";
                        }
                        
                        return 0;
                        

                        }

                        • -1
                          @ 2024-11-29 17:01:23
                          #include<iomanip>
                          using namespace std;
                          int main()
                          {
                          int a;
                          cin>>a;
                          if(a%4==0)
                          {
                          cout<<"Y";
                          }
                          else
                          {
                          cout<<"N";
                          }
                          return  0;
                          }
                          
                          • -1
                            @ 2023-5-7 11:41:04

                            #include using namespace std; int main() { int a; char c; cin>>a; if(a%40&&a%100!=0&&a%4000) { cout<<"Y"; } else { cout<<"N"; } return 0; }

                            • -1
                              @ 2023-4-22 17:09:23
                              #include<cstdio>
                              #include<string>
                              #include<bits/stdc++.h>
                              #define LL long long
                              using namespace std;
                              const int INF=0x3f3f3f3f;
                              const int N=2e5+10;
                              int a;
                              int main(){
                              	cin>>a;
                              	if(a%100!=0&&a%4==0||a%400==0){
                              		cout<<"Y";
                              	}else{
                              		cout<<"N";
                              	}
                              }
                              
                              
                              • -1
                                @ 2023-4-21 21:10:29

                                #include using namespace std; const int INf=0x3f3f3f3f; const int N=2e4+10; int main(){ long long a; cin >>a; if( ( a%40 && a%100!=0 ) || ( a%4000 ) ) cout <<"Y"; else cout <<"N"; return 0; }

                                • -1
                                  @ 2023-4-4 20:50:57

                                  #include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; if(n%40&&n%100!=0||n%4000) cout<<"Y"; else cout<<"N"; return 0; }

                                  • -1
                                    @ 2023-3-1 20:22:49

                                    #include using namespace std; int main(){ int a; cin>>a; if (a%4==0) { cout << "Y"; } else { cout << "N"; }

                                    return 0;
                                    

                                    }

                                    • -3
                                      @ 2022-9-27 17:11:40

                                      #include <bits/stdc++.h>

                                      using namespace std;

                                      int main() { int a;

                                      cin >> a;
                                      
                                      if (a % 4 == 0 && a % 100 != 0)
                                      {
                                          cout << "Y";
                                      }
                                      else if (a % 400 == 0)
                                      {
                                          cout << "Y";
                                      }
                                      else
                                      {
                                          cout << "N";
                                      }
                                      
                                      return 0;
                                      

                                      }

                                      • -3
                                        @ 2022-9-3 13:30:16
                                        #include <bits/stdc++.h>
                                        
                                        using namespace std;
                                        
                                        int main()
                                        {
                                            int a;
                                        
                                            cin >> a;
                                        
                                            if (a % 4 == 0 && a % 100 != 0)
                                            {
                                                cout << "Y";
                                            }
                                            else if (a % 400 == 0)
                                            {
                                                cout << "Y";
                                            }
                                            else
                                            {
                                                cout << "N";
                                            }
                                        
                                            return 0;
                                        }
                                        
                                        • -3
                                          @ 2022-5-4 20:24:37

                                          #include <bits/stdc++.h>

                                          using namespace std;

                                          int main() { int n; cin >>n; if(n % 4 == 0 && n % 100 != 0) { cout << "Y"; } else if(n % 400 == 0) { cout << "Y"; } else { cout << "N"; } }

                                          信息

                                          ID
                                          866
                                          时间
                                          1000ms
                                          内存
                                          256MiB
                                          难度
                                          5
                                          标签
                                          递交数
                                          1588
                                          已通过
                                          606
                                          上传者