此题两次AC使用不同的代码
注意个人的费用为0时不必输出
//
// main.cpp
// PATA1016
//
// Created by Phoenix on 2018/2/1.
// Copyright © 2018年 Phoenix. All rights reserved.
//
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 1010;
int toll[24];
int ans;
struct People {
char name[25];
int mon, dd, hh, mm;
int status;
}peo[maxn];
//此方法计算每个时间与0:0:0的时间差与费用,再相减即可;若隔天加上一整天的时间和费用即可
int num, money;
void Money(People a, People b) {
num = 0; money = 0;
int d1, h1, m1, d2, h2, m2;
d1 = a.dd; d2 = b.dd;
h1 = a.hh; h2 = b.hh;
m1 = a.mm; m2 = b.mm;
if(d1 < d2){
num += (d2 - d1) * 24 * 60;
money += (d2 - d1) * ans * 60;
}
int num1 = 0, num2 = 0;
int money1 = 0, money2 = 0;
for(int i = 0; i < h1; i++) {