返回列表 發帖
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x;
  7.     cout<<"請輸入想換算的分鐘數(超過60):";
  8.     cin>>x;
  9.     cout<<x<<"分鐘可換算成";
  10.     if(x>=1440)
  11.     {
  12.         cout<<x/1440<<"天 ";
  13.         x=x%1440;
  14.     }
  15.     if(x>=60&&x<1440)
  16.     {
  17.         cout<<x/60<<"小時 ";
  18.         x=x%60;
  19.     }
  20.     if(x>0&&x<60)
  21.         cout<<x<<"分鐘"<<endl;
  22.     system("pause");
  23.     return 0;
  24. }
複製代碼

TOP

返回列表