From 8e05eb4bfc5c52fad6d6254f6cef15c4ee0adc24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=90=E7=83=A8=20=E6=A2=85?= <1042906887@qq.com> Date: Fri, 4 Jan 2019 20:41:35 +0800 Subject: [PATCH] trans --- {translation => trans}/query log.txt | Bin 3528 -> 4032 bytes {translation => trans}/trans.h | 0 {translation => trans}/username_pwAD.txt | 2 + trans/username_pwCOM.txt | Bin 0 -> 303 bytes {translation => trans}/word_coll.txt | Bin {translation => trans}/wordd.txt | Bin {translation => trans}/wordd_coll.txt | 0 {translation => trans}/源.cpp | 203 ++++++++--------------- translation/username_pwCOM.txt | 0 9 files changed, 73 insertions(+), 132 deletions(-) rename {translation => trans}/query log.txt (87%) rename {translation => trans}/trans.h (100%) rename {translation => trans}/username_pwAD.txt (66%) create mode 100644 trans/username_pwCOM.txt rename {translation => trans}/word_coll.txt (100%) rename {translation => trans}/wordd.txt (100%) rename {translation => trans}/wordd_coll.txt (100%) rename {translation => trans}/源.cpp (81%) delete mode 100644 translation/username_pwCOM.txt diff --git a/translation/query log.txt b/trans/query log.txt similarity index 87% rename from translation/query log.txt rename to trans/query log.txt index 104f604bbb9c8fe8eaf6acc85ca4a5f725e0f702..89fabf5d2fa32ec0dd215f022a97e671283426a1 100644 GIT binary patch delta 12 UcmX>heL#N03Es^gn13(=04J*j=Kufz delta 7 OcmX>ge?of030?pW0s}|@ diff --git a/translation/trans.h b/trans/trans.h similarity index 100% rename from translation/trans.h rename to trans/trans.h diff --git a/translation/username_pwAD.txt b/trans/username_pwAD.txt similarity index 66% rename from translation/username_pwAD.txt rename to trans/username_pwAD.txt index 688f0c4..a08a91b 100644 --- a/translation/username_pwAD.txt +++ b/trans/username_pwAD.txt @@ -2,3 +2,5 @@ 123 132 123 +456 +456 diff --git a/trans/username_pwCOM.txt b/trans/username_pwCOM.txt new file mode 100644 index 0000000000000000000000000000000000000000..f41cc3e63ea03b09a5bb54e440976db1a5e5105b GIT binary patch literal 303 ScmXpsGG_QkYhXBRECB$SZ6b^S literal 0 HcmV?d00001 diff --git a/translation/word_coll.txt b/trans/word_coll.txt similarity index 100% rename from translation/word_coll.txt rename to trans/word_coll.txt diff --git a/translation/wordd.txt b/trans/wordd.txt similarity index 100% rename from translation/wordd.txt rename to trans/wordd.txt diff --git a/translation/wordd_coll.txt b/trans/wordd_coll.txt similarity index 100% rename from translation/wordd_coll.txt rename to trans/wordd_coll.txt diff --git a/translation/源.cpp b/trans/源.cpp similarity index 81% rename from translation/源.cpp rename to trans/源.cpp index df589d2..081a785 100644 --- a/translation/源.cpp +++ b/trans/源.cpp @@ -27,14 +27,9 @@ void REGISTCOM() { // struct userna_pw *regi1=(struct userna_pw*)malloc(sizeof(struct userna_pw)); FILE *fp; fp = fopen("username_pwCOM.txt", "a+"); //******************* //ûýṹļ - //memset(regi1->name1, 0, 101 * sizeof(char)); - //memset(regi1->passd1, 0, 101 * sizeof(char)); - //memset(regi1->passd2, 0, 101 * sizeof(char)); printf("\t*************************\n"); printf("\t* û *\n"); gets_s(regi1->name1); - //na0 = &uni0; - //pw0 = na0; while (1) { printf("\t* *\n"); gets_s(regi1->passd1); //ͬṹļ @@ -46,13 +41,7 @@ void REGISTCOM() { // printf("\t* *\n"); } else { - //strcpy(regi_n->name, regi1.name1); - //strcpy(regi_p->pw, regi1.passd1); - fwrite(regi1,sizeof(struct userna_pw),1 ,fp); - //fputs("\n", fp); - //fputs(regi1.passd1, fp); - //fputs("\n", fp); printf("*עɹ*\n"); system("pause"); fclose(fp); @@ -251,24 +240,10 @@ void PRINTF1_1() if (strstr(chec->word_, tempor) !=NULL) { printf("\n"); printf("%s", chec->word_); - //fread(strstr(((struct w_word *)check)->trans_, tempor), sizeof(struct w_word), 20, fp); - //puts(check->trans_); - //printf("\n"); - //printf(".\t"); - //fwrite(((struct w_word *)check)->setence, sizeof(struct w_word),20, fp); - //puts(check->setence); printf("\n"); - //x = 1; - //break; - //system("pause"); } } rewind(fp); - //fclose(fp); - //printf("\t* سһ \n"); - //system("pause"); - //FILE *fpp; - //fpp = fopen("wordd.txt", "r"); while (fread(check, sizeof(struct w_word),1, fp) != NULL) { if (strstr(check->word_, tempor) == (char *)(check->word_)) { printf("\n"); @@ -282,11 +257,8 @@ void PRINTF1_1() printf("\n"); x = 1; break; - //system("pause"); } } - //system("pause"); - //printf("\t* سһ \n"); system("pause"); if(x==0) { @@ -492,19 +464,12 @@ void IMPORT() { // printf("\n"); printf("\t* 뵥 *\n"); scanf("%s",&(tr + i)->word_); - //(tr + i)->word_[strlen((tr + i)->word_) ]='\0'; - //fputs((wd+i)->word_, fp2); - //fputs(" ", fp2); printf("\t* ǰ浥ʵķ *\n"); scanf("%s", &(tr + i)->trans_); getchar(); - //fputs((tr + i)->trans_, fp2); - //fputs("\n", fp2); printf("\n"); printf("\t* ǰ浥ʵ *\n"); gets_s((tr+ i)->setence); - //fputs((wd + i)->setence, fp2); - //fputs("\n", fp2); rewind(fp2); while (feof(fp2) != EOF) { while (fread(wd, sizeof(struct w_word), 1, fp2) != NULL) { @@ -521,7 +486,6 @@ void IMPORT() { // fwrite((tr+i),sizeof(struct w_word),1,fp2); printf("\n"); } - //rewind(fp2); fclose(fp2); return; @@ -551,7 +515,7 @@ void VIEW() { // } //鿴͹û void LOANDMA() { - int x = 0; + int x = 0,at=0; struct userna_pw *usp=(struct userna_pw*)malloc(sizeof(struct userna_pw)); char number[100]; //char n[20]; @@ -564,30 +528,30 @@ void LOANDMA() { return; } else { - while (feof(fp5) != EOF) { - while (fread(usp,sizeof(struct userna_pw),1,fp5) != NULL) { + while (!feof(fp5)) { + if(fread(usp,sizeof(struct userna_pw),1,fp5) != NULL) { printf("****û"); puts(usp->name1); printf("****룺"); puts(usp->passd1); + at = 1; } - break; } } - //fflush(fp5); fclose(fp5); - system("pause"); - printf("\t* Ƿѡɾû *\n"); - printf("\t* 1. 2. *\n"); - char keyy = getch(); - if (keyy == '1') { - FILE *fpp; - fpp = fopen("username_pwCOM.txt","r"); - rewind(fpp); - //struct userna_pw asd; - struct userna_pw us[105]; - int i=0,m1=(-1),qu=0; + //system("pause"); + if (at == 1) { + printf("\t* Ƿѡɾû *\n"); + printf("\t* 1. 2. *\n"); + char keyy = getch(); + if (keyy == '1') { + FILE *fpp; + fpp = fopen("username_pwCOM.txt", "r"); + rewind(fpp); + //struct userna_pw asd; + struct userna_pw us[105]; + int i = 0, m1 = (-1), qu = 0; while (1) { printf("\t* ûû *\n"); scanf("%s", number); @@ -598,57 +562,59 @@ void LOANDMA() { else break; } - while (!feof(fpp)) { - if (fread(&us[i], sizeof(struct userna_pw), 1, fpp) != NULL) { - i++; - } + while (!feof(fpp)) { + if (fread(&us[i], sizeof(struct userna_pw), 1, fpp) != NULL) { + i++; } - fclose(fpp); - if (i == 0) { - printf("* û *"); - system("pause"); - return; + } + fclose(fpp); + if (i == 0) { + printf("* û *"); + system("pause"); + return; + } + for (int m = 0; m < i; m++) { + if (strcmp(us[m].name1, number) == 0) { + m1 = m; + break; } - for (int m = 0; m < i; m++) { - if (strcmp(us[m].name1, number) == 0) { - m1 = m; - break; - } + } + if (m1 == -1) { + printf("* û *"); + qu = 1; + + } + else { + for (int s = m1; s < i; s++) { + us[s] = us[s + 1]; } - if(m1==-1){ - printf("* û *"); - qu = 1; - + i--; + if ((fpp = fopen("username_pwCOM.txt", "w")) == NULL) { + return; } - else { - for (int s = m1; s < i; s++) { - us[s] = us[s + 1]; - } - i--; - if ((fpp = fopen("username_pwCOM.txt", "w")) == NULL) { - return; + for (int k = 0; k < i; k++) { + if (fwrite(&us[k], sizeof(struct userna_pw), 1, fpp) != 1) { + printf("* ɾʧ *"); + system("pause"); + x = 1; } - for (int k = 0; k < i; k++) { - if (fwrite(&us[k], sizeof(struct userna_pw), 1, fpp) != 1) { - printf("* ɾʧ *"); - system("pause"); - x = 1; - } - } - //printf("* ɾɹ *"); - } - if (x == 0) { - printf("\t* ɾɹ *\n"); - printf("\t* سһ *\n"); - system("pause"); } + //printf("* ɾɹ *"); + } + if (x == 0) { + printf("\t* ɾɹ *\n"); + printf("\t* سһ *\n"); + system("pause"); + } - return; + return; + } } else { - return; + printf("\t************-û-**************\n"); + system("pause"); } - + return; } //浥ʼ¼ void WORD_CO(struct w_word *inpu) { @@ -666,14 +632,6 @@ void FWORD_CO() { printf("\t* ʼ¼ *\n"); printf("\t*****************************************\n"); struct w_word *fword=(struct w_word *)malloc(sizeof(struct w_word)); - //struct word_coll { - // char word1[100]; - // char trans1[200]; - // struct word_coll *next; - // int a; - //}; - //struct word_coll *head = NULL; - //struct word_coll *prev=NULL, *current; char input[50]; FILE *fp7; fp7 = fopen("word_coll.txt", "r"); @@ -682,18 +640,12 @@ void FWORD_CO() { system("pause"); return; } - while (feof(fp7) != EOF) { - while (fread(fword, sizeof(struct w_word), 1, fp7) != NULL && input[0] != '\0') { - //current = (struct word_coll*)malloc(sizeof(struct word_coll)); - //if (head == NULL) - // head = current; - //else - //prev->next = current; - //current->next = NULL; + while (!feof(fp7)) { + if(fread(fword, sizeof(struct w_word), 1, fp7) != NULL && input[0] != '\0') { + printf("\t"); puts(fword->word_); + printf("\t"); puts(fword->trans_); - //prev = current; - //memset(input, 0, sizeof(char) * 50); } } printf("\t**************س*****************\n"); @@ -710,39 +662,26 @@ void QUE(struct w_word *input) { } //ʾѯ¼ void FQUE() { + int n=1; system("cls"); printf("\t*****************************************\n"); printf("\t* ѯ¼ *\n"); printf("\t*****************************************\n"); struct w_word *fque = (struct w_word *)malloc(sizeof(struct w_word)); - //struct query_l { - // char word2[100]; - // char trans2[200]; - // struct query_l *next; - // int a; - //}; - //struct query_l *head = NULL; - //struct query_l *prev=NULL , *current; - //char inputt[50]; FILE *fp7; fp7 = fopen("query log.txt", "r"); - while (feof(fp7) != EOF) { - while (fread(fque, sizeof(struct w_word), 1,fp7) != NULL) { - //current = (struct query_l*)malloc(sizeof(struct query_l)); - //if (head == NULL) - // head = current; - //else - // prev->next = current; - //current->next = NULL; + while (!feof(fp7)) { + if(fread(fque, sizeof(struct w_word), 1,fp7) != NULL) { + printf("********%d********\n", n); + n++; + printf("\t"); puts(fque->word_); + printf("\t"); puts(fque->trans_); - //prev = current; - //memset(inputt, 0, sizeof(char) * 50); } } printf("\t**************س*****************\n"); - while (getchar() != '\n') - continue; + system("pause"); return; } //ʾʱ diff --git a/translation/username_pwCOM.txt b/translation/username_pwCOM.txt deleted file mode 100644 index e69de29..0000000