#include #include typedef struct list{ int d; struct list *next; } list; list *head; void wypisz(){ list* pom=head; while(pom!=NULL){ printf("%i\n",pom->d); pom=pom->next;} } void usun(int x){ int i=0; list* pom=head; for(i;inext; } list* wsk=pom->next; pom->next=wsk->next; free(wsk); } int main() { int i,x; for(i=0;i<4;i++) { list* nowy=(list*)malloc(sizeof(list)); nowy->d=i; if(i==0){nowy->next=NULL;}else {nowy->next=head;} head=nowy; } wypisz(); printf("ktory chcesz usunac "); scanf("%i",&x); usun(x-1); wypisz(); return 0; }