- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int a;
- cout<<"請輸入你想換算地秒鐘數: ";
- cin>>a;
- cout<<a<<"秒鐘可換算為..."<<endl;
- cout<<a/(24*60*60*7)<<"週";
- a=a%(24*60*60*7);
- cout<<a/(24*60*60)<<"天,";
- a=a%(24*60*60);
- cout<<a/(60*60)<<"時";
- a=a%(60*60);
- cout<<a/60<<"分";
- a=a%60;
- cout<<a<<"秒鐘,"<<endl;
-
-
- system ("pause");
- return 0;
-
- }
複製代碼 |