返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main(){
  5.     re:
  6.     int x;
  7.     cout<<"請輸入你想換算的分鐘數:"<<endl;
  8.     cin>>x;
  9.     if(x<=0)
  10.     goto re;
  11.     else{
  12.         cout<<x<<"分鐘可換算為..."<<endl;

  13.         if(x>=1440){
  14.             cout<<x/1440<<"天 ";
  15.             x=x%1440;
  16.         }
  17.         if(x>=60){
  18.             cout<<x/60<<"小時 ";
  19.             x=x%60;
  20.         }
  21.         if(x>0)
  22.             cout<<x<<"分鐘";

  23.         cout<<endl;
  24.     }
  25.     goto re;
  26.     system("pause");
  27.     return 0;
  28. }
複製代碼

TOP

返回列表