| ||||||||||
| 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>
#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator