2 条题解

  • 1
    @ 2026-4-18 14:26:29
    #include<bits/stdc++.h>
    using namespace std;
    int year;
    int main(){
        cin>>year;
        if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) cout << "Yes" << endl;
        else cout << "No" << endl;
        return 0;
    }
    

    求赞,谢谢!

    • -1
      @ 2024-12-24 9:14:32

      C++ :

      #include<bits/stdc++.h>
      using namespace std;
      int main(){
      	int a;
      	cin>>a;
      	if(a%4==0&&a%100!=0||a%400==0)cout<<"Yes"<<endl;
      	else cout<<"No"<<endl;
      	return 0;
      }
      

      Python :

      # coding=utf-8
      x = int ( input () )
      if(x % 4 == 0 and x%100 != 0):
          print ("Yes")
      elif(x % 400 == 0):
              print ("Yes")
      else:
          print("No")
      
      • 1

      信息

      ID
      551
      时间
      1000ms
      内存
      128MiB
      难度
      1
      标签
      (无)
      递交数
      187
      已通过
      154
      上传者