帮忙修改下错误....错误显示为NO EXCEPTATION
#include<stdio.h>#include<string.h>
enter();
browse();
search();
exit();
system();
input();
save();
printf_back();
load();
printf_face();
getch();
printf_one();
void menu()
{
int n,w1;
do
{
printf("\t\t************************************************\n\n");
printf("\t\t************************************************\n\n");
printf("\t\t *** choose function ************\n\n");
printf("\t\t *** 1 Enter new data ************\n\n");
printf("\t\t *** 2 Search by people.name and num*****\n\n");
printf("\t\t *** 3 Browse data ************\n\n");
printf("\t\t *** 4 Exit ************\n\n");
printf("\t\t************************************************\n\n");
printf("\t\t************************************************\n\n");
printf("Choose your number(1-4):[ ]\b\b");
scanf("%d",&n);
if(n<1||n>4) w1=1;
else w1=0;
}
while(w1==1);
switch(n)
{
case 1:enter();break;
case 2:search();break;
case 3:browse();break;
case 4:exit(0);
}
}
main()
{
system("cls");
menu();
}
#define N 100
struct people
{
char num[100];
char name[15];
char sex[20];
char age[20];
char xueli[20];
char gongzhi[20];
char address[20];
char telephone[20];
}
people[N];
# include <stdio.h>
enter()
{
int i,n;
printf("How many people(0-%d)?:",N-1);
scanf("%d",&n);
printf("\n Enter data now\n\n");
for(i=0;i<n;i++)
{
printf("\n Input %dth people record.\n",i+1);
input(i);
}
if(i!=0)save(n);
printf_back();
}
browse()
{
int i,n;
n=load();
printf_face();
for(i=0;i<n;i++)
{
if((i!=0)&&(i%10==0))
{
printf("\n\nPass any key to continue ....");
getch();
puts("\n\n");
}
printf_one(i) ;
}
printf("\tThere are %d record.\n",n);
printf("\nPass any key to back ...");
getch();
menu();
}
search()
{
int i,n,k,w1=1,w2,w3,w4,m,a;
struct people p;
n=load();
do
{
printf("\n\nWhich way do you want to choose? \n\t1).By mane By num [ ]\b\b");
scanf("%d",&m);
switch(m)
{
case 1:
do
{ k=-1;
printf("\n\nEnter name that you want to search name.");
scanf("%s",p.name);
printf_face();
for(i=0;i<n;i++)
if(strcmp(p.name,people[i].name)==0)
{ k=i;
printf_one(k);
break;
}
if(k==-1)
{ printf("\n\nNO exist!please");
printf("\n\nAre you again?\n\t1).again 2).NO and back [ ]\b\b");
scanf("%d",&w1);
if(w1==2)
printf_back();
}
}
while(k==-1&&w1==1);
break;
case 2:
do
{k=-1;
printf("\n\nEnter num that you want to search num.");
scanf("%s",p.num);
printf_face();
for(i=0;i<n;i++)
{k=i;
printf_one(k);break;
}
if(k==-1)
{
printf("\n\nNO exist!please");
printf("\n\nAre you again?\n\t1).again 2).NO and back [ ]\b\b");
scanf("%d",&w1);
if(w1==2)
printf_back();
}
}
while(k==-1&&w1==1);
break;
menu();
}
估计就是后面的seach出了问题,帮忙测试下,谢谢了
新人没分送,不好意思。