using namespace std;
#include <iostream>
// Include Open Babel classes for OBMol and OBConversion
#include <openbabel/mol.h>
#include <openbabel/obconversion.h>

int main(int argc,char **argv)
{
 // Read from STDIN (cin) and Write to STDOUT (cout)
 OBConversion conv(&cin,&cout);

 // Try to set input format to MDL SD file
 // and output to SMILES
 if(conv.SetInAndOutFormats("SDF","SMI"))
 { 
    OBMol mol;
    if(conv.Read(&mol))
    {
       //  ...manipulate molecule 
       cerr << " Molecule has: " << mol.NumAtoms() 
	    << " atoms." << endl;
    }

    // Write SMILES to the standard output
    conv->Write(&mol);
 }
 return 0; // exit with success
}

