#21999: 不用陣列(C++)


s10711123@mail2.blsh.tp.edu.tw (Ritsuki)

學校 : 臺北市立百齡高級中學
編號 : 110747
來源 : [101.136.241.255]
最後登入時間 :
2021-02-03 16:26:58

#include<bits/stdc++.h>

using namespace std;

int main(){

    int a,b;

    int N;

    while(cin >> a >> b >> N){

        cout << a/b << ".";

        for(int i=0;i<N;i++){

            a=(a%b)*10;

            cout << a/b;

        }

        cout << endl;

    }

 

    return 0;

}