Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

怎么回编译出错?

Posted by sting0218 at 2008-02-01 17:03:51 on Problem 2328
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator