5 solutions

  • 1
    @ 2025-9-14 16:13:50

    #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
    185
    Accepted
    84
    Uploaded By