dna.cpp: In function 'void init(std::string, std::string)':
dna.cpp:5:42: error: 'x' was not declared in this scope
5 | int cnt_for_a1 = count(a.begin()+x,a.begin()+y,'A');
| ^
dna.cpp:5:54: error: 'y' was not declared in this scope
5 | int cnt_for_a1 = count(a.begin()+x,a.begin()+y,'A');
| ^
dna.cpp:5:26: error: 'count' was not declared in this scope; did you mean 'std::count'?
5 | int cnt_for_a1 = count(a.begin()+x,a.begin()+y,'A');
| ^~~~~
| std::count
In file included from /usr/include/c++/11/string:52,
from dna.h:1,
from dna.cpp:1:
/usr/include/c++/11/bits/stl_algo.h:4059:5: note: 'std::count' declared here
4059 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
| ^~~~~
dna.cpp:9:54: error: 'cnt' was not declared in this scope; did you mean 'int'?
9 | if(cnt_for_a1 != cnt_for_b1 || cnt_for_a2 != cnt)
| ^~~
| int
dna.cpp:11:24: error: return-statement with a value, in function returning 'void' [-fpermissive]
11 | return -1;
| ^~
dna.cpp:19:20: error: return-statement with a value, in function returning 'void' [-fpermissive]
19 | return cnt / 2;
| ~~~~^~~
dna.cpp: In function 'int get_distance(int, int)':
dna.cpp:25:9: error: 'cin' was not declared in this scope
25 | cin>>n>>q;
| ^~~
dna.cpp:26:9: error: 'string' was not declared in this scope
26 | string a,b;
| ^~~~~~
dna.cpp:26:9: note: suggested alternatives:
In file included from /usr/include/c++/11/string:39,
from dna.h:1,
from dna.cpp:1:
/usr/include/c++/11/bits/stringfwd.h:79:33: note: 'std::string'
79 | typedef basic_string<char> string;
| ^~~~~~
In file included from dna.h:1,
from dna.cpp:1:
/usr/include/c++/11/string:67:11: note: 'std::pmr::string'
67 | using string = basic_string<char>;
| ^~~~~~
dna.cpp:27:14: error: 'a' was not declared in this scope
27 | cin>>a>>b;
| ^
dna.cpp:27:17: error: 'b' was not declared in this scope
27 | cin>>a>>b;
| ^
dna.cpp:32:17: error: 'cout' was not declared in this scope
32 | cout<<get_distance(a,b,x,y)<<'\n';
| ^~~~