目录
13. 练习13 : 整数十位
14. 练习14 : 时间转换
15. 练习15 : 小雨的游泳时间
13. 练习13 : 整数十位
解题方法:
#include <iostream>
using namespace std;
int a;
int main()
{cin >> a;cout << a % 100 / 10 << endl;return 0;
}
14. 练习14 : 时间转换
解题方法:
#include <iostream>
using namespace std;
int time;int main()
{cin >> time;cout << time / 60 / 60 << " " << time / 60 % 60 << " " << time % 60 <<
endl; return 0;
}
15. 练习15 : 小雨的游泳时间
解题方法:
#include <iostream>
using namespace std;
int main()
{int a, b, c, d;cin >> a >> b >> c >> d;int h, m;int t = c * 60 + d - a * 60 - b;//计算机出时间差,单位是分钟h = t / 60;m = t % 60;cout << h << " " << m << endl;return 0;