hdoj-1036-Average is not Fast Enough!(水题,坑)

Posted 朤尧

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了hdoj-1036-Average is not Fast Enough!(水题,坑)相关的知识,希望对你有一定的参考价值。

 题目链接:Average is not Fast Enough!

 

 1 #include <iostream>
 2 #include <cstring>
 3 #include <string>
 4 #include <cstdio>
 5 using namespace std;
 6 int main() 
 7 {
 8     int n, id;
 9     double d;
10     cin>>n>>d;
11     while (cin>>id) {
12         printf("%3d: ", id);
13         int mark = 0;
14         int time = 0;
15         for (int i=0; i<n; i++) {
16             string str;
17             cin>>str;
18             if (str[0] == -) {
19                 mark = 1;
20 //                printf("-\n");不能在这里输出,因为会碰到多个不及格的,WA了数次 
21             }
22             if(mark==1)continue;
23             time += (str[0]-0) * 3600+ ((str[2]-0)*10+(str[3]-0)) * 60 + (str[5]-0)*10+(str[6]-0);
24         }
25         if (mark == 1) {
26             printf("-\n");
27             continue;
28         }
29         double a = time / d;
30         int t = (int)(a + 0.5);
31         printf("%d:%02d min/km\n", t/60, t%60);
32     }
33     return 0;
34 }

 

以上是关于hdoj-1036-Average is not Fast Enough!(水题,坑)的主要内容,如果未能解决你的问题,请参考以下文章

python is not None

python代码`if not x:` 和`if x is not None:`和`if not x is None:`使用

ClojureScript Is Not CoffeeScript

Servlet jsp is not available

如何在 SQL Server 中检查 Is not Null 和 Is not Empty 字符串?

Python `if x is not None` 或 `if not x is None`? [关闭]