Language: C++

#include <iostream>
using namespace std;
int main()
{
	int long long=n;
	cin>>n;
	n%10=a;
	n%100=b;
	n%1000=c;
	n%10000=d;
	n%100000=e;
	n%1000000=f;
	n%10000000=g;
	n%100000000=h;
	n%1000000000=i;
	if(a<3) a=0
	if(3<=a<5) a=1;
	if(5<=a<7) a=2;
	if(7<=a) a=3;
	if(b<3) b=0
	if(3<=b<5) b=1;
	if(5<=b<7) b=2;
	if(7<=b) b=3;
	if(c<3) c=0
	if(3<=c<5) c=1;
	if(5<=c<7) c=2;
	if(7<=c) c=3;
	if(d<3) d=0
	if(3<=d<5) d=1;
	if(5<=d<7) d=2;
	if(7<=d) d=3;
	if(e<3) e=0
	if(3<=e<5) e=1;
	if(5<=e<7) e=2;
	if(7<=e) e=3;
	if(f<3) f=0
	if(3<=f<5) f=1;
	if(5<=f<7) f=2;
	if(7<=f) f=3;
	if(g<3) g=0
	if(3<=g<5) g=1;
	if(5<=g<7) g=2;
	if(7<=g) g=3;
	if(h<3) h=0
	if(3<=h<5) h=1;
	if(5<=h<7) h=2;
	if(7<=h) h=3;
	if(i<3) i=0
	if(3<=i<5) i=1;
	if(5<=i<7) i=2;
	if(7<=i) i=3;
	int ans;
	ans=a+ab+abc+abcde+abcdef+abcdefg+abcdefgh+abcdefghi;
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:22: error: expected unqualified-id before '=' token
    5 |         int long long=n;
      |                      ^
a.cc:6:14: error: 'n' was not declared in this scope
    6 |         cin>>n;
      |              ^
a.cc:7:14: error: 'a' was not declared in this scope
    7 |         n%10=a;
      |              ^
a.cc:8:15: error: 'b' was not declared in this scope
    8 |         n%100=b;
      |               ^
a.cc:9:16: error: 'c' was not declared in this scope
    9 |         n%1000=c;
      |                ^
a.cc:10:17: error: 'd' was not declared in this scope
   10 |         n%10000=d;
      |                 ^
a.cc:11:18: error: 'e' was not declared in this scope
   11 |         n%100000=e;
      |                  ^
a.cc:12:19: error: 'f' was not declared in this scope
   12 |         n%1000000=f;
      |                   ^
a.cc:13:20: error: 'g' was not declared in this scope
   13 |         n%10000000=g;
      |                    ^
a.cc:14:21: error: 'h' was not declared in this scope
   14 |         n%100000000=h;
      |                     ^
a.cc:15:22: error: 'i' was not declared in this scope
   15 |         n%1000000000=i;
      |                      ^
a.cc:53:15: error: 'ab' was not declared in this scope; did you mean 'abs'?
   53 |         ans=a+ab+abc+abcde+abcdef+abcdefg+abcdefgh+abcdefghi;
      |               ^~
      |               abs
a.cc:53:18: error: 'abc' was not declared in this scope; did you mean 'abs'?
   53 |         ans=a+ab+abc+abcde+abcdef+abcdefg+abcdefgh+abcdefghi;
      |                  ^~~
      |                  abs
a.cc:53:22: error: 'abcde' was not declared in this scope
   53 |         ans=a+ab+abc+abcde+abcdef+abcdefg+abcdefgh+abcdefghi;
      |                      ^~~~~
a.cc:53:28: error: 'abcdef' was not declared in this scope
   53 |         ans=a+ab+abc+abcde+abcdef+abcdefg+abcdefgh+abcdefghi;
      |                            ^~~~~~
a.cc:53:35: error: 'abcdefg' was not declared in this scope
   53 |         ans=a+ab+abc+abcde+abcdef+abcdefg+abcdefgh+abcdefghi;
      |                                   ^~~~~~~
a.cc:53:43: error: 'abcdefgh' was not declared in this scope
   53 |         ans=a+ab+abc+abcde+abcdef+abcdefg+abcdefgh+abcdefghi;
      |                                           ^~~~~~~~
a.cc:53:52: error: 'abcdefghi' was not declared in this scope
   53 |         ans=a+ab+abc+abcde+abcdef+abcdefg+abcdefgh+abcdefghi;
      |                                                    ^~~~~~~~~