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