| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
怎么回编译出错?#include<stdio.h>
#include<string.h>
#define m 101
typedef struct ptr{
int a;
char b[m];
char c[m];
};
ptr test[m];
main(){
int i=0,flag=0,j;
scanf("%d",&test[i].a);
while(test[i].a){
scanf("%s%s",test[i].b,test[i].c);
if(strcmp(test[i].c,"on")!=0){
i++;
scanf("%d",&test[i].a);
}
else
{
flag=0;
for(j=0;j<i;j++){
if(strcmp(test[j].c,"high")==0&&test[j].a<=test[i].a){
printf("Stan is dishonest\n");
flag=1;
i=0;
break;
}
else if(strcmp(test[j].c,"low")==0&&test[j].a>=test[i].a){
printf("Stan is dishonest\n");
flag=1;
i=0;
break;
}
else if((strcmp(test[j].c,"high")==0||strcmp(test[j].c,"low")==0)&&test[j].a==test[i].a){
printf("Stan is dishonest\n");
flag=1;
i=0;
break;
}
}
if(!flag){
printf("Stan may be honest\n");
i=0;
}
scanf("%d",&test[i].a);
}
}
}
在自己的上没问题,提交上去怎么就不行了啊!!!
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator