Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(void) {
- cout << "Time is seconds: ";
- int t_in_sec;
- cin >> t_in_sec;
- int H=t_in_sec/3600;
- int M=(t_in_sec%3600)/60;
- int S=(t_in_sec%3600)%60;;
- cout << "\nTime in hh:mm:ss = ";
- cout << H << ":" << M << ":" << S << endl;
- cout << endl;
- decision:
- cout << "Run Again(Yes/No)?" << endl;
- string y_n; cout << "->"; cin.sync(); getline(cin,y_n);
- if (y_n=="Yes" || y_n =="yes") {
- cout << endl;
- main();
- }
- else if (y_n=="No" || y_n=="no")
- cout << "\nThank You." << endl;
- else {
- cout << "\nF**k You! Yes/No only.\n" << endl;
- goto decision;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement