compile通过,build出现错误??
#include<stdio.h>#include<string.h>
int mian()
{
int ji(int a,int b);
int t,*p[100],change;
int n,m,min,sec,i,j,time[100],score[100]={0};
char song[100][31],str[31];
while(scanf("%d",&n) && n){
scanf("\n");
for(i=0; i<n; i++){
scanf("%s%d:%d\n",song[i],&min,&sec);
time[i]=min*60+sec;
p[i]=score+i;
}
scanf("%d\n",&m);
for(i=0; i<m; i++){
scanf("%s%d:%d\n",str,&min,&sec);
t=min*60+sec;
for(j=0; j<n; j++)
if(strcmp(song[j],str)==0)
score[j]+=ji(t,time[j]);
}
for(i=0; i<n; i++)
for(j=1; j<n; j++)
if(*p[i] < *p[j] || *p[i]==*p[j] && strcmp(song[p[i]-score],song[p[j]-score])>0){
change=*p[i];
*p[i]=*p[j];
*p[j]=change;
}
for(i=0;i<n ;i++)
printf("%s %d\n",song[p[i]-score],*p[i]);
}
return 0;
}
int ji(int a,int b)
{
if ((double)a/(double)b<0.20)
return 1;
else if((double)a/(double)b<0.40)
return 2;
else if((double)a/(double)b<0.60)
return 3;
else if((double)a/(double)b<0.80)
return 4;
else return 5;
}
我的工程是win32 console application 文件是 c++ source file
网上找了种错的解决方法,没什么用。。。。求大虾帮助。。。!!!!!!!
compile 通过,但是build的时候出现错误:
--------------------Configuration: a - Win32 Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/a.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
a.exe - 1 error(s), 0 warning(s)