For this Question: Mahi hates the number 7.

We are interested in integers without the digit 7 in both decimal and octal. How many such integers are there between 1 and N (inclusive)?Input is given from Standard Input in the following format:
N

<b>Constraints</b>
1&le;N&le;10^5
 
N is an integer.Print an integer representing the answer.<b>Sample Input 1</b>
20
<b>Sample Output 1</b>
17
<b>Sample Input 2</b> 
100000
<b>Sample Output 2</b>
30555

Note: Octal number system has base 8 instead of 10., I have written this Solution Code: #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(void){
    int n, a = 0;
    cin >> n;
    for(int i=1;i<=n;i++){
 
        int v = i;
        bool flg = true;
        while(v > 0){
            if(v%10 == 7) flg = false;
            v /= 10;
        }
        v = i;
        while(v > 0){
            if(v%8== 7) flg = false;
            v /= 8;
        }
        if(flg) a++;
    }
    cout << a << endl;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?