卡在70分?求问哪里错了

P5707 【深基2.例12】上学迟到

chengwenhao @ 2023-11-15 21:48:58



int main()
{

    int s=0,v=0,t=0,a=0,b=0,c=0,d=0,e=0,f=0;

    scanf("%d%d\n",&s,&v);

    for(t=1;;t++)
    {

        a=t*v;

     if(a>=s)

       break;

    }

  if(t<=470)

   if((t+10)<=60)

       if((t+10)>50)
       {
        b=60-(t+10);

        printf("07:0%d\n",b);
       }
       else
        {b=60-(t+10);
         printf("07:%d\n",b);
        }
    else
    { c=(t+10)/60;
      d=(t+10)%60;
      e=7-c;
      f=60-d;
       if(d>50)
           printf("0%d:0%d",e,f);
       else
           printf("0%d:%d",e,f);
          }
  else{

     c=(t+10)/60-8;
     d=(t+10)%60;
     a=24-c;
     f=60-d;
       if(a<10)
         if(d>50)
          printf("0%d:0%d",a,f);
         else
          printf("0%d:%d",a,f);
       else
         if(d>50)
           printf("%d:0%d",a,f);
         else
           printf("%d:%d",a,f);
  }  

    return 0;

}

|