关键在于清空字符数组和使用scanf进行输入
#include <stdio.h>
#include <string.h>
#include <fstream>
#include <iostream>
using namespace std;
int main()
{
int num;
while (scanf("%d", &num) != EOF)
{
char earlest[20];
char lastest[20];
char thisone[20];
int h1, h2, m1, m2, s1, s2;
scanf("%s%d%*c%d%*c%d %d%*c%d%*c%d", &thisone, &h1, &m1, &s1, &h2, &m2, &s2);
int ear = 3600 * h1 + 60 * m1 + s1;
int lat = 3600 * h2 ......
阅读全文