Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <time.h>
- using namespace std;
- int main()
- {
- int minutes = 0;
- int hours = 0;
- int seconds = 0;
- int days = 0;
- while(true)
- {
- system("cls");
- time_t current = time(0);
- cout << ctime(¤t) << endl;
- cout << "Days: " << days << endl;
- cout << "Hours: " << hours << endl;
- cout << "Minutes: " << minutes << endl;
- cout << "Seconds: " << seconds << endl;
- for(int i = 0; i < 1; i++)
- {
- seconds += 1;
- }
- if(seconds == 60)
- {
- minutes += 1;
- seconds = 0;
- }
- if(minutes == 60)
- {
- hours += 1;
- minutes = 0;
- }
- if(hours == 24)
- {
- days += 1;
- hours = 0;
- }
- Sleep(1000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement