返回列表 發帖
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;

  4. int main()
  5. {
  6.     int m;
  7.     cout<<"請輸入你想換算的秒數:";
  8.     cin>>m;
  9.     cout<<m<<"秒可換算為..."<<endl;
  10.     cout<<m/(24*60*60*7)<<"週,";
  11.     m=m%(24*60*60*7);
  12.     cout<<m/(24*60*60)<<"天,";
  13.     m=m%(24*60*60);
  14.     cout<<m/(60*60)<<"小時,";
  15.     m=m%(60*60);
  16.     cout<<m/60<<"分鐘,";
  17.     m=m%60;
  18.     cout<<m<<"秒."<<endl;
  19.     system("pause");
  20.     return 0;
  21. }
複製代碼

TOP

返回列表