標題:
時間換算機
[打印本頁]
作者:
tonyh
時間:
2011-12-10 16:23
標題:
時間換算機
本帖最後由 tonyh 於 2011-12-10 17:09 編輯
將輸入的分鐘數, 換算成幾天幾小時幾分鐘.
#include<iostream>
using namespace std;
int main()
{
int sum, a[3]; //a[0] a[1] a[2]
cout<<"請輸入您想換算的分鐘數: ";
cin>>sum;
cout<<sum<<"分鐘可換算為..."<<endl;
a[0]=sum/1440;
sum=sum%1440;
a[1]=sum/60;
a[2]=sum%60;
cout<<a[0]<<"天, "<<a[1]<<"小時, "<<a[2]<<"分鐘."<<endl;
system("pause");
return 0;
}
複製代碼
作者:
t3742238
時間:
2011-12-10 17:02
#include<iostream>
using namespace std;
int main()
{
int sum,a[3];
cout<<" 請輸入想換算的分鐘數"<<endl;
cin>>sum;
cout<<"分鐘可換算為..."<<endl;
a[0]=sum/1440;
sum=sum%1440;
a[1]=sum/60;
a[2]=sum%60;
cout<<a[0]<<"天."<<a[1]<<"小時."<<a[2]<<"分鐘."<<endl;
system("pause");
return 0;
}
複製代碼
作者:
劉漢文
時間:
2011-12-10 17:03
#include<iostream>
using namespace std;
int main()
{
int sum,a[1];
cout<<"請輸入你想換算的分鐘數: ";
cin>>sum;
cout<<sum<<"分鐘可換算為..."<<endl;
a[0]=sum/1440;
sum=sum%1440;
a[1]=sum/60;
a[2]=sum%60;
cout<<a[0]<<"天,"<<a[1]<<"小時,"<<a[2]<<"分鐘."<<endl;
system("pause");
return 0;
}
複製代碼
作者:
t2364705
時間:
2011-12-10 17:03
#include<iostream>
using namespace std;
int main()
{
int sum,a[3];
cout<<"請輸入您想換算的分鐘數: ";
cin>>sum;
cout<<sum<<"分鐘可換算為..." <<endl;
a[0]=sum/1440;
a[1]=sum/60;
a[2]=sum%60;
cout<<a[0]<<"天, "<<a[1]<<"小時, "<<a[2]<<"分鐘"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
尤泓鈞
時間:
2011-12-10 17:04
#include<iostream>
using namespace std;
int main()
{
int sum,a[3];
cout<<"請輸入你想換算的時間:";
cin>>sum;
cout<<sum<<"分鐘可換算為..."<<endl;
a[0]=sum/1440;
sum=sum%1440;
a[1]=sum/60;
a[2]=sum/60;
cout<<a[0]<<"天,"<<a[1]<<"小時,"<<a[2]<<"分鐘."<<endl;
system("pause");
return 0;
}
複製代碼
作者:
t8155745
時間:
2011-12-10 17:09
#include <iostream>
using namespace std;
int main()
{
int sum, a[3];
cout<<"請輸入您想換算的分鐘數:";
cin>>sum;
cout<<sum<<"分鐘可換質為..."<<endl;
a[0]=sum/1440;
sum=sum%1440;
a[1]=sum/60;
a[2]=sum%60;
cout<<a[0]<<"天, "<<a[1]<<"小時, "<<a[2]
<<"分鐘."<<endl;
system("pause");
return 0;
}
複製代碼
作者:
蔡昀佑
時間:
2011-12-10 17:18
#include<iostream>
using namespace std;
int main()
{
int sum, a[3]; //a[0] a[1] a[2]
cout<<"請輸入您想換算的分鐘數: ";
cin>>sum;
cout<<sum<<"分鐘可換算為..."<<endl;
a[0]=sum/1440;
sum=sum%1440;
a[1]=sum/60;
a[2]=sum%60;
cout<<a[0]<<"天, "<<a[1]<<"小時, "<<a[2]<<"分鐘."<<endl;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2