#include using namespace std; struct node { int data; struct node *next; }; int main() { struct node *pre,*head,*p; head=NULL; int n; scanf("%d",&n); for(int i=0;idata); p->next=NULL; if(head==NULL){ head=p; } else { pre->next=p; } pre=p; } int x,y; scanf("%d %d",&x,&y); struct node* ptr; ptr=head; int i=0; while(ptr!=NULL) { i++; if(i==x){ ptr->data=y; break; } ptr=ptr->next; } ptr=head; while(ptr!=NULL) { printf("%d ", ptr->data); ptr=ptr->next; } return 0; }