无法打开文件是什么错误啊

P1478 陶陶摘苹果(升级版)

director_yu @ 2019-12-22 11:25:56

编译失败总说 No valid executable file was produced by the compiler怎么解觉啊大佬求助```c

include<stdio.h>

int mian() { int i,n,p,a,b,j,item; int xy[1000][2]; scanf("%d%d" ,&n,&p); getchar(); scanf("%d%d",&a,&b); getchar(); for(i=0;i<n;i++) scanf("%d%d",&xy[i][0],&xy[i][1]); for(j=0;j<n;j++) for(i=0;i<n-j;i++){ if(xy[i][1]>xy[i+1][1]){ xy[i][1]=item; xy[i][1]=xy[i+1][1]; xy[i+1][1]=item; xy[i][0]=item; xy[i][0]=xy[i+1][0]; xy[i+1][0]=item; } } for(i=0;i<n;i++) { if(xy[i][0]<=a+b) p-=xy[i][1]; if(p<0) break; } printf("%d",i); return 0; }


by rouxQ @ 2019-12-22 11:45:46

在第一行加上

#define mian main 

by liumuxin @ 2019-12-22 11:47:08

@rouxQ 终于找到了罕见的人才!


by liumuxin @ 2019-12-22 11:48:01

话说还可以加一个

int main(){
    mian();
    return 0;
}

by tZEROちゃん @ 2019-12-22 12:02:01

@百因必有AC 这不是橙题吗(小声bb)


by 冯昱哲 @ 2019-12-22 12:42:41


上一页 |