CPP_Basics_Syntax/第一讲 变量、输入输出、表达式与顺序语句/t618.cpp

21 lines
559 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 一辆汽车每行驶 12 公里需要消耗 1 升汽油,现在告诉你该汽车的行驶速度 S
// km /
// h
// )和行驶时间 T
// h
// ),请你计算该车在行驶过程中一共消耗了多少升汽油。
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
long long T, S;
cin >> T >> S;
// cout << (T * S) / 12.0 << endl;
// printf("%.3lf", (double)T * S / 12);
cout << fixed << setprecision(3) << T * S / 12.0 << endl;
return 0;
}