Advertisement
vladm98

Untitled

Oct 9th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int v[26];
  6. int total[26];
  7. void adaug (int x, int y)
  8. {
  9. x%=y;
  10. for (int i = 1; i<=25; ++i)
  11. {
  12. x *= 10;
  13. total[i] += x/y;
  14. x %= y;
  15. }
  16. for (int i = 25; i >= 1; --i)
  17. {
  18. total[i-1] += total[i]/10;
  19. total[i] %= 10;
  20. }
  21. }
  22. int main()
  23. {
  24. ifstream fin ("error.in");
  25. ofstream fout ("error.out");
  26. int n;
  27. long long sus = 0LL, jos = 1LL;
  28. fin >> n;
  29. for (int i = 1; i<=n; ++i)
  30. {
  31. int x, y;
  32. fin >> x >> y;
  33. adaug(x, y);
  34. }
  35. for (int i = 1; i<=20; ++i)
  36. fout << total[i] << ' ';
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement