zoj 1963 Average is not Fast ...

zoj 1963 Average is not Fast ...,第1张

zoj 1963 Average is not Fast ...
#include<stdio.h>int main(){    int n;    double d;    int num;    char h,m1,m2,s1,s2;    scanf("%d",&n);    scanf("%lf",&d);    while(scanf("%d",&num)!=EOF)    {        printf("%3d: ",num);        bool flag=true;        int sumtime=0;        for(int i=0;i<n;i++)        {getchar(); scanf("%c:%c%c:%c%c",&h,&m1,&m2,&s1,&s2); if(h=='-') flag=false; if(flag==false)continue; sumtime+=(h-'0')*3600+((m1-'0')*10+(m2-'0'))*60+(s1-'0')*10+(s2-'0');        } if(flag==false)printf("-n");        else        { double t1=sumtime/d; int t2=(int)(t1+0.5); printf("%d:%02d min/kmn",t2/60,t2%60);        }        }        return 0;}

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/4926872.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-12
下一篇 2022-11-13

发表评论

登录后才能评论

评论列表(0条)

保存