4 solutions

  • 1
    @ 2026-8-14 11:47:09

    自创方法,比季总的简单不止一万倍!点赞的是彭于晏

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int M,D,y,m,d;
    	cin>>M>>D>>y>>m>>d;
    	if(m+d==M+D){
    		cout<<y+1<<" "<<1<<" "<<1;
    	}
    	else if(d==D){
    		cout<<y<<" "<<m+1<<" "<<1;
    	} 
    	else
    	{
    		cout<<y<<" "<<m<<" "<<d+1;
    	}
        return 0;
    }
    

    Information

    ID
    2323
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    227
    Accepted
    76
    Uploaded By