5 solutions

  • 0
    @ 2025-3-29 11:06:48
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int a,b,c;
    	cin>>a>>b>>c;
    	if(a+1==b&&a+2==c)
    	{
    		cout<<"TRUE";
    	}
    	else if(b-1==a||b-1==c&&b-2==a||b-2==b)
    	{
    		cout<<"TRUE";
    	}
    	else if(a-1==b&&a-2==c)
    	{
    		cout<<"TRUE";
    	}
    	else
    	{
    		cout<<"FALSE";
    	}
    	return 0;
    }
    

    Information

    ID
    35
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    # Submissions
    244
    Accepted
    64
    Uploaded By