c++,#10过不了求大佬帮助解决困惑!!
查看原帖
c++,#10过不了求大佬帮助解决困惑!!
1112185
Wwl041125楼主2023/9/27 00:30
#include<iostream>
using namespace std;

int main()
{
    int s,v;
    cin>>s >>v;
    int t1;
    t1=s/v;
    if(s%v!=0)
    {
        t1+=1;
    }
    int t2;
    t2=t1+10;
    if(t2<=1400)
    {
        if(t2<=480)
        {
            int tn1=480-t2;
            int h1,m1;
            h1=tn1/60;
            m1=tn1%60;
            if(tn1%60==0)
            {
                m1=0;
            }
            if(m1<10)
            {
               cout<<"0"<<h1<<":"<<"0"<<m1; 
            }
            else
            {
                cout<<"0"<<h1<<":"<<m1;
            }
            
        }
        else
        {
            int tn2;
            tn2=t2-480;
            int h2,m2;
            h2=23-(tn2/60);
            m2=60-(tn2%60);
            if(tn2%60==0)
            {
                m2=0;
            }
            if(tn2>780)
            {
                if(tn2%60<10)
                {
                    cout<<"0"<<h2<<":"<<"0"<<m2;
                }
                else
                {
                    cout<<"0"<<h2<<":"<<m2;
                }
            }
            else if(tn2%60>=10)
            {
                cout<<h2<<":"<<m2;
            }
            else
            {
                cout<<h2<<":"<<"0"<<m2;
            }
        }
    }
    return 0;
};
2023/9/27 00:30
加载中...