报错提示

error LNK2001: unresolved external symbol _clrscr

报错代码

#include<stdio.h>
void main()
{
int x,y,z;
clrscr();
printf("---------------------------------------------\n");
for(x=1;x<=3;x++)
for(y=1;y<=3;y++)
for(z=1;z<=3;z++)
if(x!=1&&x!=3&&z!=3&&x!=y&&x!=z&&y!=z)
{
printf(" X will marry to %c.\n",'A'+x-1);
printf(" Y will marry to %c.\n",'A'+y-1);
printf(" Z will marry to %c.\n",'A'+z-1);
}
printf("---------------------------------------------\n");
printf(" Press any key to quit...");
getch();
}

解决方法

将 clrscr() 替换为 system(“CLS”)