#include<iostream>
#include<fstream>
#include<string>
using namespace std;
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
string extract(string const& s, char first, char last)
{
auto lpos = s.find(first) + 1;
auto rpos = s.find(last, lpos);
return s.substr(lpos, rpos - lpos);
}
void print_if_contains(string const& s, char lp, string const& pattern, char rp)
{
if(extract(s, lp, rp) == pattern)
{
cout << s << "\n";
}
}
void print_if_contains(string const& s, char lp, double d, char rp)
{
if(stod(extract(s, lp, rp)) == d)
{
cout << s << "\n";
}
}
int main()
{
ifstream file("my.txt");
// ...
string line;
while(getline(file, line))
{
print_if_contains(line, '(', "0.0", ')');
print_if_contains(line, '(', 0.0, ')');
}
// ...
}