2 mayiyougekai mayiyougekai 于 2015.06.12 12:54 提问

这是一种什么样的错误呢,求科普
c

No this compiler or no test data

6个回答

itccccc
itccccc   2015.06.12 12:55

应该是编译器没配置好吧

itccccc
itccccc 回复mayiyougekai: 可能是网站服务器出了小问题
2 年多之前 回复
mayiyougekai
mayiyougekai 是提交给学校的交作业网站显示的错误。acm模式的
2 年多之前 回复
mayiyougekai
mayiyougekai   2015.06.12 12:57

是提交给学校的交作业网站显示的错误。acm模式的

mayiyougekai
mayiyougekai   2015.06.12 12:59

代码如下:
#include
#include
#define SIZE 3

struct Student
{
int num;
char name[20];
char sex[2];
int score[5];
float aver;
struct Student *next;
}stu[SIZE],*head,*p,*q;
void save()
{
FILE *fp;
int i,j;
fp = fopen("stu.c","w+");
head = p = (struct Student *)malloc(sizeof(struct Student));
head ->next = &stu[0];
for(i = 0;i < SIZE;i++)
{

    scanf("%d ",&stu[i].num);
    fprintf(fp,"%d\n",stu[i].num);
    gets(stu[i].name);
    fprintf(fp,"%s\n",stu[i].name);
    gets(stu[i].sex);
    fprintf(fp,"%s\n",stu[i].sex);
    for(j = 0;j < 5;j++)
        scanf("%d",&stu[i].score[j]);
    fprintf(fp,"%d %d %d %d %d\n",stu[i].score[0],stu[i].score[1],stu[i].score[2],
        stu[i].score[3],stu[i].score[4]);
    stu[i].aver = (stu[i].score[0] + stu[i].score[1] + stu[i].score[2] + stu[i].score[3]
        + stu[i].score[4])/5.0;
    fprintf(fp,"%f\n",stu[i].aver);
}
fclose(fp);

}

void sort()
{
FILE *fp_in,*fp_sort;
int i,j;
float stu_aver[SIZE];
struct Student temp;
fp_in = fopen("stu.c","r+");
for(i = 0;i < SIZE;i++)
{
fscanf(fp_in,"%d%f",&stu[i].num,&stu[i].aver);
//printf("fuck %f\n",stu[i].aver);
//stu_aver[i] = stu[i].aver;
}
//for(i = 0;i < SIZE;i++)
//printf("%f\n",stu_aver[i]);
for(i = 0;i < SIZE - 1;i++)
{
for(j = 0;j < SIZE - 1 - i;j++)
{
if(stu[j].aver > stu[j + 1].aver)
{
temp = stu[j];
stu[j] = stu[j + 1];
stu[j + 1] = temp;
}
}
}
fp_sort = fopen("stu-sort","w+");
for(i = 0;i < SIZE;i++)
{
fprintf(fp_sort,"%d\n",stu[i].num);
fprintf(fp_sort,"%s\n",stu[i].name);
fprintf(fp_sort,"%s\n",stu[i].sex);
fprintf(fp_sort,"%d %d %d %d %d\n",stu[i].score[0],stu[i].score[1],stu[i].score[2],
stu[i].score[3],stu[i].score[4]);
fprintf(fp_sort,"%lf\n",stu[i].aver);
}
fclose(fp_sort);
fclose(fp_in);
}

void add()
{
FILE *fp_new,*fp_in;
int i;
q = (struct Student *)malloc(sizeof(struct Student));
scanf("%d ",&(q ->num));
gets(q ->name);
gets(q ->sex);
for(i = 0;i < 5;i++)
scanf("%d",&(q ->score[i]));
q ->aver = (q ->score[0] +q ->score[1] + q ->score[2] +q ->score[3]
+ q ->score[4])/5.0;
fp_in = fopen("stu-sort","r+");
for(i = 0;i < SIZE;i++)
{
fscanf(fp_in,"%d%f",&stu[i].num,&stu[i].aver);
//printf("fuck %f\n",stu[i].aver);
//stu_aver[i] = stu[i].aver;
}
//for(i = 0;i < SIZE;i++)
//printf("%f\n",stu[i].aver);
//printf("%f\n",q ->aver);
head ->next = &stu[0];
for(i = 0;i < SIZE;i++)
{
if(i <= SIZE - 2)
stu[i].next = &stu[i + 1];
else
stu[i].next = NULL;
}
p = head;
if(q ->aver <= stu[0].aver)
{
p ->next = q;
q ->next = &stu[0];
}
else if(q ->aver >= stu[SIZE - 1].aver)
{
stu[SIZE - 1].next = q;
q ->next = NULL;
}
else
{
for(i = 0;i < SIZE - 1;i++)
{
if((q ->aver > stu[i].aver) && (q ->aver < stu[i + 1].aver))
{
stu[i].next = q;
q ->next = &stu[i + 1];
}
}
}
fclose(fp_in);
fp_new = fopen("new","w+");
p = head ->next;
for(;;)
{
fprintf(fp_new,"%d\n",p ->num);
fprintf(fp_new,"%s\n",p ->name);
fprintf(fp_new,"%s\n",p ->sex);
fprintf(fp_new,"%d %d %d %d %d\n",p ->score[0],p ->score[1],p ->score[2],
p ->score[3],p ->score[4]);
fprintf(fp_new,"%lf\n",p ->aver);
p = p ->next;
if(p == NULL)
break;
}
fclose(fp_new);

}

void search()
{
int i;
p = head ->next;
for(;;)
{
for(i = 0;i < 5;i++)
{
if(p ->score[i] < 60)
{
printf("%d\n",p ->num);
printf("%s\n",p ->name);
printf("%s\n",p ->sex);
printf("%d %d %d %d %d\n",p ->score[0],p ->score[1],p ->score[2],
p ->score[3],p ->score[4]);
printf("%lf\n",p ->aver);
break;
}
}
if(p ->aver >= 90)
{
printf("%d\n",p ->num);
printf("%s\n",p ->name);
printf("%s\n",p ->sex);
printf("%d %d %d %d %d\n",p ->score[0],p ->score[1],p ->score[2],
p ->score[3],p ->score[4]);
printf("%lf\n",p ->aver);
}
p = p ->next;
if(p == NULL)
break;
}
}

int main(void)
{
//FILE *fp;
//int i,j;
save();
sort();
add();
printf("\n");
search();
return 0;
}

lzp_lrp
lzp_lrp   Ds   Rxr 2015.06.12 14:14

翻译过来就是

没有这个编译器或没有测试数据

是不是编译器出问题了?重装一下试试

a1193561652
a1193561652   Rxr 2015.06.12 15:26

没有编译器或测试数据?编译器的问题?估计是你的工程没建好。

dominating413421391
dominating413421391   2015.06.17 11:31

不同oj的配置不同,解决方案是选择c++或g ++相关语言编译,看看是否支持编译,以后按你的代码风格选择编译语言,希望能A C

Csdn user default icon
上传中...
上传图片
插入图片