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;
    }
    
    • 0
      @ 2025-7-31 14:59:31

      想法猎物让他

      • -3
        @ 2024-12-17 20:31:43
        #include<bits/stdc++.h> 
        using namespace std;
        int main()
        {
        	int a,b;
        	cin>>a>>b;
        	if(a>=b)
        	{
        		b=b+24;
        	}
        	cout<<b-a;
        	return 0;
        }
        
        • -4
          @ 2024-10-20 11:23:20
          #include<bits/stdc++.h>
          using namespace std;
          int main()
          {
          	int a,b;
          	cin>>a>>b;
          	if(a>=b)
          	{
          		b=b+24;
          	}
          	cout<<b-a;
          	return 0;
          }
          • 1

          Information

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