出现两个链接错误error LNK2001: unresolved external symbol _ptinffatal error LNK1120:
用选择法对10个整数排序(从小到大)# include <stdio.h>
void main()
{
int i,j,min,temp,a[11];
printf("enter data:\n");
for(i = 1;i <= 10;i++)
{
printf("a[%d]=",i);
scanf("%d",&a[i]);
}
printf("\n");
printf("The original numbers:\n");
for(i = 1;i <= 10;i++)
printf("%5d",a[i]);
for(i = 1;i <= 9;i++)
{ //min = j;
// for(j = i + 1;j <= 10;j++)
for(j = i + 1;j <= 10;j++) //if(a[i] > a[j])min = j;
if(a[i] > a[j])
temp = a[i]; //temp = a[i];
a[i] = a[j]; //a[i] = a[min];
a[j] = temp; //a[min] = temp; 为什么非得写后面那种格式,前面那种错误。
}
printf("\n");
printf("The sorted numbers:\n");
for(i = 1;i <= 10;i++)
printf("%5d",a[i]);
ptinf("\n");
}
顺便帮忙看下程序