- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- re:
- int sec;
- double c1,c2;
- int c;
- cout<<"請輸入要數的秒數"<<endl;
- cin>>sec;
- c1=clock();
- while(c!=sec)
- {
- c2=clock();
- c=(c2-c1)/1000;
- cout<<(c2-c1)/1000<<"秒"<<endl;
- system("cls");
- }
- cout<<"<<時間到 經過了"<<sec<<"秒"<<endl;
- system ("pause");
- system("cls");
- goto re;
- return 0;
- }
複製代碼 |