struct Polinom { int coef; int x; int y; int z; Polinom* next; }; void __fastcall TForm2::BitBtn1Click(TObject *Sender) { string str; Polinom *pointer, head; pointer=&head; str= (Edit1->Text).c_str(); int in=0; int coef=0; int x=0,y=0,z=0; while(sscanf(str.c_str(),"%d*x^%d*y^%d*z^%d",&coef,&x,&y,&z)) { pointer->next = new Polinom; pointer=pointer->next; pointer->x=x; pointer->y=y; pointer->z=z; pointer->coef=coef; str.erase(0,(str.find('+')>str.find('-'))?str.find('-'):str.find('+')); //ShowMessage(IntToStr(pointer->x)); }