diff --git a/student.txt b/student.txt new file mode 100644 index 0000000..469c59f --- /dev/null +++ b/student.txt @@ -0,0 +1,2 @@ +18408200212 刘宇宽 17 男 2001.03 湖南新化 13873884359 1634704423 +18408200212 周志 18 2000.03 湖南娄底 18378627862 763627376353 \ No newline at end of file diff --git a/zengjia.exe b/zengjia.exe index 98ba912..7327afc 100644 Binary files a/zengjia.exe and b/zengjia.exe differ diff --git a/涓诲嚱鏁.c b/涓诲嚱鏁.c index df05475..1252eba 100644 --- a/涓诲嚱鏁.c +++ b/涓诲嚱鏁.c @@ -46,11 +46,11 @@ switch(num) case 1:refresh();break; case 2:seek();break; -//case 3:modify();break; +case 3:modify();break; case 4:add();break; -/*case 5:dele();break; +case 5:dele();break; case 6:show();break; -case 7:save();break;*/ +case 7:save();break; case 8:exit(0); default:printf("请在1-8之间选择\n"); } diff --git a/鍒犻櫎鍑芥暟鍜屼繚瀛樺嚱鏁.c b/鍒犻櫎鍑芥暟鍜屼繚瀛樺嚱鏁.c index b1065e8..6c17010 100644 --- a/鍒犻櫎鍑芥暟鍜屼繚瀛樺嚱鏁.c +++ b/鍒犻櫎鍑芥暟鍜屼繚瀛樺嚱鏁.c @@ -1,4 +1,4 @@ -#include"显示.cpp" +#include"显示.c" void dele() /* 删除信息 */ { int i,j,flag=0; diff --git a/鍒犻櫎鍑芥暟鍜屼繚瀛樺嚱鏁.exe b/鍒犻櫎鍑芥暟鍜屼繚瀛樺嚱鏁.exe new file mode 100644 index 0000000..7de9db9 Binary files /dev/null and b/鍒犻櫎鍑芥暟鍜屼繚瀛樺嚱鏁.exe differ diff --git a/鍒锋柊鍑芥暟鍜屾煡鎵惧嚱鏁.c b/鍒锋柊鍑芥暟鍜屾煡鎵惧嚱鏁.c index d152572..7563d02 100644 --- a/鍒锋柊鍑芥暟鍜屾煡鎵惧嚱鏁.c +++ b/鍒锋柊鍑芥暟鍜屾煡鎵惧嚱鏁.c @@ -5,7 +5,7 @@ void refresh()/* int i=0;/*计算导入学生的个数*/ if((fp=fopen("student.txt","r"))==NULL) { - printf("cannot open the file"); + printf("未找到该文件 请先创立该文件并将学生信息保存\n"); system("pause"); exit(0);/*如未能打开直接退出程序*/ } diff --git a/瀛︾敓淇℃伅绠$悊鍑芥暟瀹屾暣鐗.c b/瀛︾敓淇℃伅绠$悊鍑芥暟瀹屾暣鐗.c new file mode 100644 index 0000000..e9004ef --- /dev/null +++ b/瀛︾敓淇℃伅绠$悊鍑芥暟瀹屾暣鐗.c @@ -0,0 +1,53 @@ +#include"删除函数和保存函数.c" +void modify()/*修改函数*/ +{ + int num,j,i; + char s1[LEN+1],s2[LEN+1];/*用于存放新的学生信息*/ + loop:printf("请输入要修改学生的学号:"); + scanf("%s",s1); + for(i=0;i