Untitled
unknown
plain_text
a month ago
756 B
1
Indexable
Never
#include<iostream> #include<ctime> #include<iomanip> using namespace std; void sekonda_kaluar(time_t start_time,time_t end_time){ double sekonda_kaluar=difftime(end_time, start_time); int ora = static_cast<int>(sekonda_kaluar)/3600; int minutat = (static_cast<int>(sekonda_kaluar)%3600)/60; int sekondat = static_cast<int>(sekonda_kaluar)%60; cout<<"Koha e kaluar eshte :"<<endl; cout<<ora<<" :: "<<minutat<<" :: "<<sekondat<<endl; } int main(){ cout<<"Shtyp butonin ENTER qe te nise kronometri"; cin.get(); time_t start_time=time(nullptr); cout<<"Kronometri ka filluar !Shtyp prape ENTER kur do ta ndalosh"; cin.get(); time_t end_time=time(nullptr); sekonda_kaluar(start_time, end_time); return 0; }
Leave a Comment