Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int h=0;
int m=0;
int s=0;
while(n!=0){
s++;
if(s==60){
s=0;
m++;
}
if(m==60){
m=0;
h++;
}
n--;
}
cout<<h<<":"<<m<<":"<<s<<endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment