样例和下载的测试点1答案都是对的,可为什么全WA了?
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
LL read() {
LL f=2,sum=0,cnt=0;
char c;
while(cin>>c) {
if(c==':') {
if(f==2) {
cnt+=sum*3600;
} else if(f==1) {
cnt+=sum*60;
}
f--;
sum=0;
} else if(c>='0'&&c<='9') {
sum=sum*10+c-48;
} else break;
}
cnt+=sum;
return cnt;
}
int main() {
LL a,b,c;
a=read();
b=read();
cin>>c;
cout<<(b-a)*c;
return 0;
}