Files
python/LuoGu/RuMen/P1615.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

49 lines
999 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <bits/stdc++.h>
using namespace std;
/**
* 功能:将字符串转为整数
* 作者:黄海
* 时间2019-11-24
* @param str
* @return
*/
unsigned int stou(const string &str) {
unsigned int n;
stringstream ssTmp(str);
ssTmp >> n;
return n;
}
long long getSenconds(string temp) {
int count = 0;
int shi, fen, miao = 0;
string str = "";
for (int i = 0; i < temp.size(); i++) {
if (temp[i] != ':') {
str += temp[i];
} else {
count++;
if (count == 1) shi = stou(str);
if (count == 2) fen = stou(str);
str = "";
}
}
miao = stou(str);
return shi * 60 * 60 + fen * 60 + miao;
}
int main() {
ios::sync_with_stdio(false); //读入输出优化的强迫症
string a, b;
int c;
cin >> a >> b >> c;
long long q = getSenconds(b) - getSenconds(a);
cout << q * c << endl;
return 0;
}