- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- re:
- int time;
- cout<<"請輸入你想換算的分鐘數: ";
- cin>>time;
- cout<<time<<"分鐘可換算為..."<<endl;
- {
- if(time>=1440)
- {cout<<time/1440<<"天, ";
- time%=1440;}
- if(time>=60)
- {cout<<time/60<<"小時, ";
- time%=60;}
- if(time>=1)
- {cout<<time/1<<"分鐘";
- time%=1;}
- }
- cout<<endl;
- goto re;
- system("pause");
- return 0;
- }
複製代碼 |