Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std ;
- int main () {
- int n = 2019;
- int a[n];
- a[0] = 0;
- a[1] = 1;
- for (int i = 2; i < n; i += 2){
- a[i] = a [i / 2];
- a[i + 1]= a[i / 2] + 1;
- }
- int counter = 0;
- for(auto i: a)
- if (i == 7) counter++;
- cout << counter;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement