You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# 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 ;
}