Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- #include <limits>
- using namespace std;
- int main() {
- string line;
- getline(cin, line);
- int hours = stoi(line.substr(0, line.find(':'))),
- minutes = stoi(line.substr(line.find(':') + 1, line.find_last_of(':'))),
- seconds = stoi(line.substr(line.find_last_of(':') + 1));
- long int steps, stepPerSeconds;
- cin >> steps >> stepPerSeconds;
- unsigned long int totalSeconds = hours * 3600 + minutes * 60 + seconds + steps * stepPerSeconds;
- printf("Time Arrival: %0.2d:%0.2d:%0.2d", totalSeconds / 3600 % 24, totalSeconds % 3600 / 60, totalSeconds % 60);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement