This is what i've come up with yet, and I know it is incorrect because if you change the parameters in the sample input, the output goes all wrong.
Code:
#include <fstream.h>
void main ()
{
char CLASS[50];
ifstream fin;
fin.open("sample_input.txt");
fin.getline(CLASS, 20, '\n');
ofstream fout;
fout.open("code.txt");
fout<<"#include <iostream>"<<"\n";
fout<<"using namespace std;"<<"\n";
fout<<CLASS<<endl;
fout<<"{"<<endl;
fin.seekg(27);
fin.getline(CLASS, 50, ')');
fout<<CLASS<<":"<<endl;
fin.seekg(51);
fin.getline(CLASS, 10, ')');
fout<<CLASS;
fin.seekg(40);
fin.getline(CLASS, 20, '(');
fout<<CLASS<<";"<<endl;
fin.seekg(51);
fin.getline(CLASS, 20, ')');
fout<<CLASS;
fin.seekg(60);
fin.getline(CLASS, 10, '(');
fout<<CLASS<<";"<<endl;
fin.seekg(83);
fin.getline(CLASS, 10, ')');
fout<<CLASS;
fin.seekg(78);
fin.getline(CLASS, 10, '(');
fout<<CLASS<<";"<<endl;
cout<<fin.tellg();
fin.close();
fout.close();
}