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