commit fe981749d8ebf4e8cba52a8f1ce62863ac48ad1e Author: 王罗凯 <18408000511@stu.hut.edu.cn> Date: Wed Jan 9 22:51:59 2019 +0800 xss diff --git a/Makefile.win b/Makefile.win new file mode 100644 index 0000000..c1fe0f6 --- /dev/null +++ b/Makefile.win @@ -0,0 +1,28 @@ +# Project: ÏîÄ¿1 +# Makefile created by Dev-C++ 5.11 + +CPP = g++.exe -D__DEBUG__ +CC = gcc.exe -D__DEBUG__ +WINDRES = windres.exe +OBJ = main.o +LINKOBJ = main.o +LIBS = -L"D:/dvc/Dev-Cpp/MinGW64/lib" -L"D:/dvc/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib" -static-libgcc -g3 +INCS = -I"D:/dvc/Dev-Cpp/MinGW64/include" -I"D:/dvc/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"D:/dvc/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" +CXXINCS = -I"D:/dvc/Dev-Cpp/MinGW64/include" -I"D:/dvc/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"D:/dvc/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"D:/dvc/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++" +BIN = ÏîÄ¿1.exe +CXXFLAGS = $(CXXINCS) -g3 +CFLAGS = $(INCS) -g3 +RM = rm.exe -f + +.PHONY: all all-before all-after clean clean-custom + +all: all-before $(BIN) all-after + +clean: clean-custom + ${RM} $(OBJ) $(BIN) + +$(BIN): $(OBJ) + $(CC) $(LINKOBJ) -o $(BIN) $(LIBS) + +main.o: main.c + $(CC) -c main.c -o main.o $(CFLAGS) diff --git a/main.c b/main.c new file mode 100644 index 0000000..09fdd26 --- /dev/null +++ b/main.c @@ -0,0 +1,108 @@ +#include +#include +#include +int main(){ +int choice; +printf("»¶Ó­Ê¹ÓÃѧÉú¿¼ÊÔϵͳ\n"); +char name[100]; +char xuehao[110]; +//ÉèÖÃÁ½¸ö´¢´æÐÕÃûºÍѧºÅµÄ×Ö·û´®Êý×é +printf("ÇëÑ¡Ôñϵͳ¹¦ÄÜÑ¡Ï1£ºµÇÈë 0£ºÍ˳ö\n") ; +//Ä£ÄâÕýʽ¿¼ÊÔϵͳʱµÄ¿¼ÊÔ½çÃæ +scanf("%d",&choice); +switch(choice) +{ +case 1:printf("ÇëÊäÈëÄãµÄÐÕÃû¡¢Ñ§ºÅ\n"); +scanf("%s",name); +scanf("%s",xuehao); +//ʹÓÃ×Ö·û´®Êý×éÊäÈëÐÕÃûºÍѧºÅ + int a,b,c,i,j,score[10],trueValue,sum=0; + srand(time(NULL)); +for( i=0;i<10;i++){ +for(a=rand()%51,b=rand()%51;a+b>50 || a+b<0 || a-b>50 || a-b<0; a=rand()%51,b=rand()%51) +c=rand()%2; +//ʹÓÃrangº¯ÊýËæ»úÉú³É[0£¬50]ÒÔÄÚµÄÊý×Ö +//cËæ»úÉú³É0ºÍ1£¬·Ö±ð¶ÔÓ¦¼Ó·¨ºÍ¼õ·¨ +for( j=0;j<3;j++){ +if(c==1){ +printf("%d:%d+%d=",i+1,a,b); +trueValue=a+b; +//¼Ó·¨¹«Ê½ +scanf("%d",&score[i]); +if(score[i]!=trueValue){ +printf("´ð°¸´íÎó£¬ÇëÖØÐÂÊäÈë.\n"); +score[i]=0; +} +else{ +if(j==0){ +score[i]=10; +} +else if(j==1){ +score[i]=7; +} +else{ +score[i]=5; +} +break; +} +} +//¼Ó·¨µÄ¼Æ·Ö·½Ê½ +else{ +printf("%d:%d-%d=",i+1,a,b); +trueValue=a-b; +//¼õ·¨µÄ¹«Ê½ +scanf("%d",&score[i]); +if(score[i]!=trueValue){ +printf("´ð°¸´íÎó£¬ÇëÖØÐÂÊäÈë.\n"); +score[i]=0; +} +else{ +if(j==0){ +score[i]=10; +} +else if(j==1){ +score[i]=7; +} +else{ +score[i]=5; +} +break; +} +} +} + +if(score[i]==0){ +printf("ÕýÈ·´ð°¸ÊÇ£º%d\n",trueValue); +} +//¼õ·¨µÄ¼Æ·Ö·½Ê½ +sum=sum+score[i]; +} +printf("ÄãµÄ³É¼¨ÊÇ:%d\n",sum); +if(sum>90){ +printf("SMART.\n"); +} +else if(sum>=80){ +printf("GOOD.\n"); +} +else if(sum>=70){ +printf("OK.\n"); +} +else if(sum>=60){ +printf("PASS.\n"); +} +else{ +printf("TRYAGAIN\n"); +} + +break; +case 0:break;} + +return 0; +} + + + + + + + diff --git a/main.o b/main.o new file mode 100644 index 0000000..fe9f5cf Binary files /dev/null and b/main.o differ diff --git a/项目1.dev b/项目1.dev new file mode 100644 index 0000000..6a1de9d --- /dev/null +++ b/项目1.dev @@ -0,0 +1,62 @@ +[Project] +FileName=ÏîÄ¿1.dev +Name=ÏîÄ¿1 +Type=1 +Ver=2 +ObjFiles= +Includes= +Libs= +PrivateResource= +ResourceIncludes= +MakeIncludes= +Compiler= +CppCompiler= +Linker= +IsCpp=0 +Icon= +ExeOutput= +ObjectOutput= +LogOutput= +LogOutputEnabled=0 +OverrideOutput=0 +OverrideOutputName= +HostApplication= +UseCustomMakefile=0 +CustomMakefile= +CommandLine= +Folders= +IncludeVersionInfo=0 +SupportXPThemes=0 +CompilerSet=1 +CompilerSettings=0000000000000000001000000 +UnitCount=1 + +[VersionInfo] +Major=1 +Minor=0 +Release=0 +Build=0 +LanguageID=1033 +CharsetID=1252 +CompanyName= +FileVersion= +FileDescription=Developed using the Dev-C++ IDE +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion= +AutoIncBuildNr=0 +SyncProduct=1 + +[Unit1] +FileName=main.c +CompileCpp=0 +Folder= +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + diff --git a/项目1.exe b/项目1.exe new file mode 100644 index 0000000..fd471fd Binary files /dev/null and b/项目1.exe differ