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 90303109 at 2004-01-02 11:31:49 on Problem 1028
#include <stdio.h>
#include <string.h>
#include <malloc.h>

void main(){
	int i=0;
	int ii=0;
	int n=-1;
	char act[8];//what does it want to do.
	char rcd[101][71];//the record
	char url[101][71];//the url.
	strcpy(url[0],"http://www.acm.org/");
	scanf("%s",&act);
	for(;act[0]!='Q';){
		n++;
		if(act[0]=='V'){
			i++;
			ii++;
			scanf("%s",url[i]);
			strcpy(rcd[n],url[i]);
		}
		else if(act[0]=='B'){
			i--;
			if(i<0){
				i=0;
				strcpy(rcd[n],"Ignored");
			}
			else strcpy(rcd[n],url[i]);
		}
		else if(act[0]=='F'){
			i++;
			if(i>ii){
				i--;
				strcpy(rcd[n],"Ignored");
			}
			else {
				strcpy(rcd[n],url[i]);
			}
		}
		scanf("%s",&act);
	}
	for(i=0; i<=n; i++)
		printf("%s\n",rcd[i]);
}

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