fork(2) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. long long a, b, n, dig, m = 0;
  4.  
  5. int main()
  6. {
  7. freopen("SOTHUC.inp", "r", stdin);
  8. freopen("SOTHUC.out", "w", stdout);
  9. ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  10. cin >> a >> b >> n;
  11. a = a % b;
  12. for (int i = 1; i <= n; i++)
  13. {
  14. a = a * 10;
  15. dig = a / b;
  16. a = a % b;
  17. }
  18. cout << dig;
  19. return 0;
  20. }
Runtime error #stdin #stdout 0.01s 5524KB
stdin
Standard input is empty
stdout
Standard output is empty