#includestdio.hintmain(intargc,char*argv[]){inti,j,k,k2,t;intn1;intn2;intpageseq[100];intmempages[10][2];intn3;intn4;intreplacedPage;printf(×ÜÒ³Ãæ:);scanf(%d,&n1);if(n11){printf(Ò³Ãæ´íÎó!\n);return1;}printf(pagenumber:);scanf(%d,&n2);for(i=0;in2;i++){printf(%d-thpageis:,i+1);scanf(%d,&t);pageseq[i]=t;}n3=0;n4=0;for(i=0;in2;i++){for(j=0;jn3;j++){if(mempages[j][0]==pageseq[i])break;}if(j==n3&&n3n1){mempages[n3][0]=pageseq[i];mempages[n3][1]=i+1;n3++;n4++;}elseif(j==n3){intminv;minv=mempages[0][1];k2=0;for(k=1;kn3;k++){if(minvmempages[k][1]){k2=k;minv=mempages[k][1];}}replacedPage=mempages[k2][0];mempages[k2][0]=pageseq[i];mempages[k2][1]=i+1;n4++;printf(page%din,page%dout.%d-thmissingpage.\n,pageseq[i],replacedPage,n4);}else{printf(page%disinmemory.\n,pageseq[i]);}}printf(Totally%dmissingpages!\n,n4);return0;}