6 条题解

  • 1
    @ 2024-1-11 11:12:47
    #include<stdio.h>
    int main(){
    int x,y,ans=0;
    int yue[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    scanf("%d %d",&x,&y);
    if(x % 4 == 0&& x % 100 != 0 || x % 400 == 0)
    yue[1]+=1;
    ans+=yue[y-1];
    printf("%d",ans);
    return 0;
    }``
    
    ```
    
    ```
    • 1
      @ 2023-12-7 22:51:34

      #include <stdio.h> int main() { int x,y; int flag=0; scanf("%d %d",&x,&y); int a[2][13]={{31,28,31,30,31,30,31,31,30,31,30,31},{31,29,31,30,31,30,31,31,30,31,30,31}}; if((x%40&&x%100!=0)||x%4000) flag=1; printf("%d",a[flag][y-1]); return 0; }

      • 0
        @ 2023-11-9 19:35:23
         
        #include<stdio.h>
        int main()
        {
            int year, month, days;
          
                scanf("%d %d", &year, &month);
            switch(month)
            { case 1:
              case 3:
              case 5:
              case 7:
              case 8:
              case 10:
              case 12:days = 31;  break;
              case 4:
              case 6:
              case 9:
              case 11:days = 30; break;
              case 2:
                  if (year % 400 == 0 || year % 4 == 0 && year % 100 != 0)
                      days = 29;
                  else
                      days = 28; break;
         
         
            }
            printf("%d",days);
            return 0;
        }
        
        • 0
          @ 2023-9-16 14:03:38

          #include<stdio.h> int main(){ int x,y;1<=y&&y<=12; scanf("%d %d",&x,&y); switch(y){ case 1: case 3: case 5: case 7: case 8: case 10: case 12: printf("31");break; case 4: case 6: case 9: case 11: printf("30");break; case 2: if(x%40&&x%100!=0||x%4000) {printf("29"); }else printf("28");break; } return 0; }

          • 0
            @ 2023-8-13 21:30:05
            #include<stdio.h>
            int main(){
            	int x,y ;
            	scanf("%d%d",&x,&y);
            		if(y==1||y==3||y==5||y==7||y==8||y==10||y==12){
            	printf("31");
            		}
            		else
            		if(y==6||y==4||y==9||y==11)
            		{printf("30");
            		}
            		else
            		if(y==2)
            		{
            			if((x%400==0)||(x%4==0&&x%100!=0)){
            			printf("29");	
            			}
            			else{
            				printf("28");
            			}}return 0;
            		}
            
            • 0
              @ 2022-10-7 18:05:37
              #include<stdio.h>
              int main(){
              	int x,y ;
              	scanf("%d%d",&x,&y);
              		if(y==1||y==3||y==5||y==7||y==8||y==10||y==12){
              	printf("31");
              		}
              		else
              		if(y==6||y==4||y==9||y==11)
              		{printf("30");
              		}
              		else
              		if(y==2)
              		{
              			if((x%400==0)||(x%4==0&&x%100!=0)){
              			printf("29");	
              			}
              			else{
              				printf("28");
              			}}return 0;
              		}
              
              • 1

              信息

              ID
              43
              时间
              1000ms
              内存
              256MiB
              难度
              7
              标签
              递交数
              3771
              已通过
              995
              上传者