自己写了一个代码只过了测试点0和3.。。。
然后百度发现没有匹配记录的用户不应该输出,于是过了一两天又重新写了一个,代码如下:
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
const int maxn=1100;
int per_bill[24];
struct customer{
char id[30];//id
char time_stre[30];//时间
bool state;
int MM,dd,hh,mm;
int rank;
}stu[maxn];
bool mouth[maxn]={
0};//记录用户每月账单是否输出过
int count_phone[maxn]={
0};//记录有几对配对的电话记录 根据rank查找
int total_cost[maxn]={
0};//记录用户总的费用
bool cmp(customer a,customer b)
{
if(strcmp(a.id,b.id)!=0)return strcmp(a.id,b.id)<0;
else if(a.MM!=b.MM)return a.MM<b