Alf big sps!
Что-то наваяла, не работает
#include <iostream.h>
#include <string.h>
struct PNode
{
int Spisok [10];
PNode* Next;
};
PNode* First1=NULL, First2 = NULL, First3= NULL;
PNode* AddFirst (PNode* First, int Data[])
{
PNode* p=new PNode ;
strcpy(p-> Spisok,Data);
//p -> Spisok = Data;
p -> Next = First;
First = p;
return First;
}
void PrintList (PNode* First)
{
PNode* p = First;
while (p)
{
cout<<p->Data<<' ';
p = p -> Next;
}
}
int main()
{
const int n=10;
int s[10];
for (int i=0;i<n;i++)
{
cout<<"Input Spisok1: ";
cin>>s;
First = AddFirst(First1,s);
}
for (int i=0;i<n;i++)
{
cout<<"Input Spisok2: ";
cin>>s;
First = AddFirst(First2,s);
}
for (int i = 0; i<n;i++) {
PNode* p = First1;
while (p)
{
AddFirst(First3,p->Spisok);
p = p->Next;
}
PNode* p = First2;
while (p)
{
AddFirst(First3,p->Spisok);
p = p->Next;
}
return 0;
}
Подскажи please в чем ошибка, скоро надо будет сдаваться