#include "oechem.h" #include using namespace OESystem; using namespace OEChem; using namespace std; unsigned int MyGetExplicitDegree(OEAtomBase *atm) { OEIter bond; unsigned int result = 0; for (bond = atm->GetBonds(); bond; ++bond) ++result; return result; } int main() { int degree; OEMol mol; OEParseSmiles(mol, "c1ccccc1"); OEIter atom; for (atom=mol.GetAtoms();atom;++atom) { degree = MyGetExplicitDegree(atom); cout << "Atom " << atom->GetIdx() << " has degree " << degree << endl; } return 0; }