diff --git a/LZT/h.c b/LZT/1.C similarity index 77% rename from LZT/h.c rename to LZT/1.C index 3eca26a..31c0111 100644 --- a/LZT/h.c +++ b/LZT/1.C @@ -44,19 +44,19 @@ void main() /* printf("\t\t\t0.退出\n\n"); /*退出*/ printf("\t\t\t请输入你的选择:"); scanf("%d",&b); - switch(b) - { - case 1:type();break; /*调用录入学生信息函数*/ - case 2:look();break; /*调用查看函数*/ - case 3:search_name();break; /*调用姓名查看学生信息函数*/ - case 4:search_number();break; /*调用学号查看学生信息函数*/ - case 5:order();break; /*调用学号排序学生信息函数*/ - case 6:del();break;/*调用删除函数*/ - case 7:save();break;/*调用保存函数*/ - case 8:see();break;/*调用打开文件函数*/ - case 0:flag=1;break;/*退出SWITCH语句*/ - default :printf("错误!"); - } + switch(b) + { + case 1:type();break; /*调用录入学生信息函数*/ + case 2:look();break; /*调用查看函数*/ + case 3:search_name();break; /*调用姓名查看学生信息函数*/ + case 4:search_number();break; /*调用学号查看学生信息函数*/ + case 5:order();break; /*调用学号排序学生信息函数*/ + case 6:del();break;/*调用删除函数*/ + case 7:save();break;/*调用保存函数*/ + case 8:see();break;/*调用打开文件函数*/ + case 0:flag=1;break;/*退出SWITCH语句*/ + default :printf("错误!"); + } if(flag) break; /*如果选择0就退出循环*/ } @@ -64,6 +64,7 @@ void main() /* void type() /*定义录入学生信息函数*/ { int i; /*定义局部变量*/ + n=openl(); /*调用openl函数*/ printf("\t\t输出你想输入的学生信息个数:"); scanf("%d",&n); for(i=0;istu[j].num) { temp=stu[i]; stu[i]= stu[j]; stu[j]=temp; } - printf("%10s\t%s\t%2s\t%d\t%d\t%d\t%3.1f\t\t%6.1f\n",stu[i].num,stu[i].name, - stu[i].sex,stu[i].english,stu[i].math,stu[i].chinese,stu[i].aver,stu[i].sum); + printf("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n",stu[i].num,stu[i].name, + stu[i].sex,stu[i].age,stu[i].ad,stu[i].tel,stu[i].E,stu[i].year,stu[i].month,stu[i].day); } getch(); printf("是否保存?(y or n)"); - getchar(); scanf("%c",&a); if(a=='y') /*是否保存排序后的文件*/ save(); @@ -183,10 +186,11 @@ void del() /* int i; char a; char name[20]; + n=openl(); printf("\t\t\t输入学生名字:\n"); scanf("%s",name); printf("\t学号\t姓名\t性别\t年龄\t地址\t电话\tE-mail\t年\t月\t日\n"); - for(i=0;i + for(i=0;i

Command Lines

-Creating temporary file "C:\Users\279800~1\AppData\Local\Temp\RSPCFE1.tmp" with contents +Creating temporary file "C:\Users\279800~1\AppData\Local\Temp\RSP8AEB.tmp" with contents [ /nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Debug/LZT.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c -"E:\信息库\LZT\h.c" +"F:\信息库\测试\pmpe26s7b\LZT\1.C" ] -Creating command line "cl.exe @C:\Users\279800~1\AppData\Local\Temp\RSPCFE1.tmp" +Creating command line "cl.exe @C:\Users\279800~1\AppData\Local\Temp\RSP8AEB.tmp" +Creating temporary file "C:\Users\279800~1\AppData\Local\Temp\RSP8AEC.tmp" with contents +[ +kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/LZT.pdb" /debug /machine:I386 /out:"Debug/LZT.exe" /pdbtype:sept +".\Debug\1.OBJ" +".\Debug\h.obj" +] +Creating command line "link.exe @C:\Users\279800~1\AppData\Local\Temp\RSP8AEC.tmp"

Output Window

Compiling... -h.c -E:\信息库\LZT\h.c(102) : error C2143: syntax error : missing ';' before 'if' -E:\信息库\LZT\h.c(102) : error C2143: syntax error : missing ')' before 'if' -E:\信息库\LZT\h.c(130) : error C2143: syntax error : missing ';' before 'if' -E:\信息库\LZT\h.c(130) : error C2143: syntax error : missing ')' before 'if' -E:\信息库\LZT\h.c(146) : error C2143: syntax error : missing ';' before 'if' -E:\信息库\LZT\h.c(146) : error C2143: syntax error : missing ')' before 'if' -E:\信息库\LZT\h.c(159) : error C2143: syntax error : missing ';' before '{' -E:\信息库\LZT\h.c(159) : error C2143: syntax error : missing ')' before '{' -E:\信息库\LZT\h.c(161) : error C2143: syntax error : missing ';' before 'if' -E:\信息库\LZT\h.c(161) : error C2143: syntax error : missing ')' before 'if' -E:\信息库\LZT\h.c(161) : error C2039: 'sum' : is not a member of 'student' - E:\信息库\LZT\h.c(15) : see declaration of 'student' -E:\信息库\LZT\h.c(162) : error C2143: syntax error : missing ')' before '{' -E:\信息库\LZT\h.c(168) : error C2039: 'english' : is not a member of 'student' - E:\信息库\LZT\h.c(15) : see declaration of 'student' -E:\信息库\LZT\h.c(168) : error C2039: 'math' : is not a member of 'student' - E:\信息库\LZT\h.c(15) : see declaration of 'student' -E:\信息库\LZT\h.c(168) : error C2039: 'chinese' : is not a member of 'student' - E:\信息库\LZT\h.c(15) : see declaration of 'student' -E:\信息库\LZT\h.c(168) : error C2039: 'aver' : is not a member of 'student' - E:\信息库\LZT\h.c(15) : see declaration of 'student' -E:\信息库\LZT\h.c(168) : error C2039: 'sum' : is not a member of 'student' - E:\信息库\LZT\h.c(15) : see declaration of 'student' -E:\信息库\LZT\h.c(189) : error C2143: syntax error : missing ';' before 'if' -E:\信息库\LZT\h.c(189) : error C2143: syntax error : missing ')' before 'if' -E:\信息库\LZT\h.c(200) : error C2146: syntax error : missing ';' before identifier 'stu' -E:\信息库\LZT\h.c(200) : error C2143: syntax error : missing ')' before ';' -E:\信息库\LZT\h.c(206) : error C2146: syntax error : missing ';' before identifier 'getch' -E:\信息库\LZT\h.c(249) : error C2143: syntax error : missing ';' before 'if' -E:\信息库\LZT\h.c(249) : error C2143: syntax error : missing ')' before 'if' -E:\信息库\LZT\h.c(249) : error C2065: 'name' : undeclared identifier -E:\信息库\LZT\h.c(249) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int ' -E:\信息库\LZT\h.c(249) : warning C4024: 'strcmp' : different types for formal and actual parameter 2 -E:\信息库\LZT\h.c(261) : error C2065: 'a' : undeclared identifier -E:\信息库\LZT\h.c(269) : error C2146: syntax error : missing ';' before identifier 'stu' -E:\信息库\LZT\h.c(269) : error C2143: syntax error : missing ')' before ';' -E:\信息库\LZT\h.c(291) : error C2084: function 'int __cdecl openl()' already has a body -E:\信息库\LZT\h.c(319) : error C2084: function 'void __cdecl see()' already has a body -E:\信息库\LZT\h.c(345) : fatal error C1004: unexpected end of file found -Error executing cl.exe. +1.C +Linking... +h.obj : error LNK2005: _main already defined in 1.OBJ +h.obj : error LNK2005: _type already defined in 1.OBJ +h.obj : error LNK2005: _save already defined in 1.OBJ +h.obj : error LNK2005: _look already defined in 1.OBJ +h.obj : error LNK2005: _search_name already defined in 1.OBJ +h.obj : error LNK2005: _search_number already defined in 1.OBJ +h.obj : error LNK2005: _order already defined in 1.OBJ +h.obj : error LNK2005: _del already defined in 1.OBJ +h.obj : error LNK2005: _openl already defined in 1.OBJ +h.obj : error LNK2005: _see already defined in 1.OBJ +Debug/LZT.exe : fatal error LNK1169: one or more multiply defined symbols found +Error executing link.exe.

Results

-h.obj - 31 error(s), 2 warning(s) +LZT.exe - 11 error(s), 0 warning(s)