70分求助 8 9 10 wa

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

sakuyayaya @ 2024-10-20 10:29:21

#include <stdio.h>
#include <math.h>
int main(){
    int i,h,m,x;
    double t,s,v;
    scanf("%lf %lf",&s,&v);
    t=s/v;
    t=ceil(t);
    for(i=1;i<=8;i++){
        if(i*60-t-10>0){
            break;
        }
    }
    h=8-i;
    m=i*60-t-10;
    if(m<10){printf("0%d:0%d",h,m);
    }
    else if(m>=10&&m<60){
    printf("0%d:%d",h,m);}
    else if(m==60){
    printf("0%d:00",h+1);}

    return 0;
}

by sakuyayaya @ 2024-10-20 10:29:41

刚刚帖子乱码了


by youyou09 @ 2024-10-20 10:41:03

@sakuyayaya 如果你的头像还没那么变态,我一定会回答你的


by sakuyayaya @ 2024-10-20 10:52:30

@youyou09 这下总行了吧


by youyou09 @ 2024-10-20 10:59:07

@sakuyayaya

#include<bits/stdc++.h>
using namespace std;
double s,v,m;
int n,a,t,b;
int main()
{
    cin>>s>>v;
    n=8*60+24*60;
    t=ceil(s/v)+10;
    n=n-t;
    if(n>=24*60) n-=24*60;
    b=n%60;
    a=n/60;
    if(a<10){
        if(b<10) cout<<"0"<<a<<":0"<<b;
        else cout<<"0"<<a<<":"<<b;
    }
    else{
        if(b<10) cout<<a<<":0"<<b;
        else cout<<a<<":"<<b;
    }
    return 0;
}

by sakuyayaya @ 2024-10-20 11:00:28

抱歉 我以为这个平台对于头像没有什么要求 @youyou09


by youyou09 @ 2024-10-20 11:01:31

@sakuyayaya 没事,我删了


by sakuyayaya @ 2024-10-20 11:02:39

我的代码有什么问题可以说说吗


by youyou09 @ 2024-10-20 11:05:45

@sakuyayaya 我看看


by sakuyayaya @ 2024-10-20 11:57:33

没问题了 已经解决了


|