Дополнен 8 лет назад
struct sp{
int inf;
struct sp *ptr;
};
int main(){
setlocale(LC_ALL, "");
sp* sptr;
sp* nptr;
sptr=NULL;
int a,n,kil;
printf("Ââåäiòü ðàçìið ñïèñêó: ");
scanf("%d",&n);
int mas[n];
printf("Çãåíåðîâàíèé çâ'ÿçàíèé ñïèñîê: \n");
for(int i=0;iinf=a;
nptr->ptr=sptr;
sptr=nptr;
}}
while(nptr!=NULL){
printf("%d \n",nptr->inf);
nptr=nptr->ptr;
}
int max=-20;
while(nptr!=NULL)
{
if(nptr->inf>max)
max=nptr->inf;
nptr=nptr->ptr;
}
printf("\nMAX: %d",max);
getch();
}
Дополнен 8 лет назад
int max=-20;
while(nptr!=NULL)
{
if(nptr->inf>max)
max=nptr->inf;
nptr=nptr->ptr;
}
printf("\nMAX: %d",max);
Проблема с самим поиском