7 solutions

  • 0
    @ 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;
    

    }

    • -1
      @ 2025-10-7 15:43:46

      #include<bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a>>b; if(a==b) { cout<<24; } else if(b>a) { a=b-a; cout<<a; } else if(a>b) { a=24-a+b; cout<<a; } return 0; }

      • -1
        @ 2025-9-27 20:04:01

        #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;
        

        } Copy -1

        张艺北 LV 3 @ 1 个月前 想法猎物让他

        -4

        祝福 LV 6 @ 9 个月前 #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; } Copy -5

        钱宇宸 LV 6 @ 11 个月前 #include<bits/stdc++.h> using namespace std;

        • -1
          @ 2025-7-31 14:59:31

          想法猎物让他

          • -2
            @ 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;
            }
            
            • -5
              @ 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;
              }
              
              • -6
                @ 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
                207
                Accepted
                94
                Uploaded By