4 solutions

  • 0
    @ 2025-7-31 15:01:29
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int a=0,b=0,c=0,n=0;
    	cin>>a>>b; 
    	if(a==b)
    	{
    		cout<<24;
    	}
    	else if(a<b)
    	{
    		c=b-a;
    		cout<<c; 
    	}
    	else if(a>b)
    	{
    		c=24-a+b;
    		cout<<c;
    	}
    	
    	
    	
    	
    	
    	
    	
    	
    	return 0;
    }
    

    Information

    ID
    24
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    182
    Accepted
    81
    Uploaded By