返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     re:
  7.         system("cls");
  8.         int a;
  9.         cout<<"輸入想換算的秒數"<<endl;
  10.         cin>>a;
  11.         if(a>60*60*24*7){
  12.             cout<<a/60/60/24/7<<"週"<<endl;
  13.             a%=60*60*24*7;
  14.         }
  15.         if(a>60*60*24){
  16.             cout<<a/60/60/24<<"天"<<endl;
  17.             a%=60*60*24;
  18.         }
  19.         if(a>60*60){
  20.             cout<<a/60/60<<"小時"<<endl;
  21.             a%=60*60;
  22.         }
  23.         if(a>60){
  24.             cout<<a/60<<"分"<<endl;
  25.             a%=60;
  26.         }
  27.         if(a>0){
  28.             cout<<a<<"秒"<<endl;
  29.         }
  30.         cout<<endl;
  31.         system("pause");
  32.         goto re;
  33.         return 0;
  34. }
複製代碼

TOP

返回列表