문제 바로가기> 백준 15792번: A/B - 2
나누기 과정을 손으로 써 내려가듯이 구현하면 된다!
#include<iostream>
using namespace std;
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
int A, B;
cin >> A >> B;
cout << A/B << ".";
A%=B;
for (int i = 0; i <= 1000; i++){
A *= 10;
cout << A/B;
A%=B;
}
}