jjh1511174232 @ 2024-10-29 22:31:39
#include<stdio.h>
main()
{
int s,v,shi,fen;
int t,f;
scanf("%d %d",&s,&v);
if(s%v==0);
{t=s/v;}
if(s%v!=0)
{t=s/v+1;}
for(;t>1440;t=t-1440);
if (t<=470)
{
f=480-10-t;
shi=f/60;
fen=f%60;
printf("%02d:%02d",shi,fen);
}
else
{
f=1440-10-t;
shi=f/60;
fen=f%60;
printf("%02d:%02d",shi,fen);
}
}
by qcllc123456 @ 2024-10-30 13:03:03
第一:我不知道是不是for少个括号(你发的图里好像没有) 第二:我自己写的时候加了一个分针进位的判定(06:60要变为07:00) 一下是我的代码
#include<stdio.h>
#include<stdlib.h>
int main(){
int t=10;
int s,v;
scanf("%d %d",&s,&v);
if(s%v!=0){
t+=s/v+1;}
else{t+=s/v;}
int t1=t%60;
int t2=t/60;
int T1=60-t1;
int T2=8-1-t2;
if(T2<0){
T2+=24;
}
if(T1==60){
T1=0;
T2=(T2+1)/24;
}
printf("%02d:%02d",T2,T1);
return 0;
}