-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstopwatch.cpp
More file actions
40 lines (39 loc) · 983 Bytes
/
Copy pathstopwatch.cpp
File metadata and controls
40 lines (39 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include<bits/stdc++.h>
#include <iomanip> //this library is needed for setw
#include<Windows.h>
using namespace std;
int main()
{
int h=0,m=0,s=0,flag;
while(true){
system("cls");
cout << setw (70);
cout<<"|-----------STOPWATCH-----------|"<<endl<<endl;
cout << setw (49);
cout<<"||---------"<<h<<":"<<m<<":"<<s<<"----------||"<<endl<<endl;
cout << setw (70);
cout<<"|-------------------------------|"<<endl;
s++;
if(s==60){
m++;
s=0;
if(m==60){
h++;
m=0;
if(h==60){
h=0;
cout<<"1.continue.."<<endl;
cout<<"2.exit.."<<endl;
cin>>flag;
if(flag==1){
continue;
}
else{
exit(0);
}
}
}
}
Sleep(500);
}
}