#include <iostream>
#include <string>
#include <vector>
using namespace std;
void divide(int a, int b, int N) {
string result;
int integerPart = a / b;
result = to_string(integerPart) + ".";
a = a % b;
for (int i = 0; i < N; ++i) {
a *= 10;
int digit = a / b;
result += to_string(digit);
a = a % b;
}
cout << result << endl;
}
int main() {
int a, b, N;
while (cin >> a >> b >> N) {
divide(a, b, N);
}
return 0;
}
divide
**:a
是被除數,b
是除數,N
是小數點後需要的精度。N
。a
, b
, N
。divide
函數進行計算並輸出結果。