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

  16. if(x>=60){
  17.         cout<<x/60<<"小時"<<endl;
  18.         x%=60;}

  19. if(x>=1)
  20.     cout<<x<<"分鐘"<<endl;

  21.     system("pause");
  22.     return 0;
  23. }
複製代碼

TOP

返回列表