Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n;
  8. cin >> n;
  9. int a = 100;
  10. cout << a << endl;
  11. for (int i = 0; i < n-1; i++){
  12. a = a * 2;
  13. int b = a;
  14. int k = 0, c = 0;
  15. while (b > 0){
  16. if (b % 10 == 0){
  17. k++;
  18. }
  19. c++;
  20. b = b / 10;
  21. }
  22. cout << c << " " << k << " ";
  23. if (k * 2 >= c){
  24. cout << a << endl;
  25. }
  26. else {
  27. int f = 1;
  28. for (int j = 0; j < k; j++){
  29. f = f * 10;
  30. }
  31. f = f * 10;
  32. a = a / f;
  33. a += 1;
  34. k++;
  35. for (int j = 0; j < k; j++){
  36. a = a * 10;
  37. }
  38. cout << a << endl;
  39. }
  40.  
  41. }
  42. return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement