Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- int a = 100;
- cout << a << endl;
- for (int i = 0; i < n-1; i++){
- a = a * 2;
- int b = a;
- int k = 0, c = 0;
- while (b > 0){
- if (b % 10 == 0){
- k++;
- }
- c++;
- b = b / 10;
- }
- cout << c << " " << k << " ";
- if (k * 2 >= c){
- cout << a << endl;
- }
- else {
- int f = 1;
- for (int j = 0; j < k; j++){
- f = f * 10;
- }
- f = f * 10;
- a = a / f;
- a += 1;
- k++;
- for (int j = 0; j < k; j++){
- a = a * 10;
- }
- cout << a << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement