Home > Back-end >  : unexpected end of file 'main' and found: the local function definitions are illegal
: unexpected end of file 'main' and found: the local function definitions are illegal

Time:10-02

Is to change a thing in programming came after, before all have no, please help to see

#include
#include
#include

Void zhucaidang ()
{
Printf (" * * * * * * * * * * * * * \ n ");
Printf (" input * * 1 entry \ n ");
Printf (" * 2 shows a thesaurus * \ n ");
Printf (" modify * * 3 entry \ n ");
Printf (" delete * * 4 entry \ n ");
Printf (" * 5 english-chinese translation * \ n ");
Printf (" * 6 information preservation * \ n ");
Printf (" * 7 exit system * \ n ");
Printf (" * * * * * * * * * * * * * \ n ");
}

Struct citiao {
Char danci [20].
Char fanyi [32].
} ciku [100].

Struct citiao test;

Int zhiling ()
{
int a;
Printf (" please enter instructions before digital \ n ");
The scanf (" % d ", & amp; A);
Return a;
}


Void shuru (int k, int c)
{
Printf (" please enter the word and its translation \ n ");
Int I=c;
K=k + I;
for(; i{
The scanf (" % s % s ", (ciku + I) - & gt; Danci (ciku + I) - & gt; Fanyi);
}
}


Void paixu (int) c
{
Int I=0, j;
for(; i{
for(j=0; j{
If (STRCMP ((ciku + j) - & gt; Danci, (ciku + j + 1) - & gt; Danci) & gt; 0)
{
Test=ciku [j];
Ciku [j]=ciku [j + 1);
Ciku [j + 1)=ciku [j];
}
}
}
}


Void xianshi (int) c
{
Int I=0;
Printf (" word list \ n ");
for(; i{
Printf (" % s \ n \ t % s ", (ciku + I) - & gt; Danci (ciku + I) - & gt; Fanyi);
}
If (c==0)
Printf (" no entries stored ");
}


B c int chazhao (int, int)
{
Char a, [20].
int i;
If (b==5)
Printf (" please enter to find spelling or translation \ n ");
Else if (b==4)
Printf (" please enter the need to delete the entry of keyword \ n ");
Else if (b==3)
Printf (" please enter the need to modify the terms of the keyword \ n ");
The scanf (" % s ", a);
for(i=0; i{
If (STRCMP ((ciku + I) - & gt; Danci, a)==0 | | STRCMP ((ciku + I) - & gt; Fanyi, a)==0)
break;
The else
Printf (" input error \ n ");
}
return i;
}


Void xiugai (int int a, c, e, b)
{
Int a, I;
Printf (" * * * * * * * * * * * * * \ n ");
Printf (" * 1 modify the word * \ n ");
Printf (" * * 2 modify translation \ n ");
Printf (" * * * * * * * * * * * * * \ n ");
Printf (" please enter instructions before digital \ n ");
The scanf (" % d ", & amp; A);
I=chazhao (c, b);
Printf (" please amend: \ n ");
If (a==1)
{
The scanf (" % s ", (ciku + I) - & gt; Danci);
}
Else if (a==2)
{
The scanf (" % s ", (ciku + I) - & gt; Fanyi);
}
}

Void shanchu (int int a, c, e, b)
{
Int I, j=0;
I=chazhao (c, b);
for(; i{
Ciku [I]=ciku [I + 1);
}
}


Int chucun (int) c
{
int i;
Ciku. TXT FILE * fp=fopen (" ", "w +");
If (fp==NULL)
{
Puts (" cannot open file!" );
return 0;
}
Fprintf (fp, "% d \ n", c);
for(i=0; i<=c; I++)
{
Fprintf (fp, "% s \ n \ t % s", (ciku + I) - & gt; Danci (ciku + I) - & gt; Fanyi);
}
The rewind (fp);
fclose(fp);
}


Int xieru (int) c
{
Int I=0;
The FILE * fp=fopen (" ciku. TXT ", "a");
If (fp==NULL)
{
Puts (" cannot open file!" );
return 0;
C=fscanf (fp, "% d", c);
fclose(fp);
Printf (" % d ", c);
Return the c;
}


Void main ()
{
Int a, k, c=0;
Xieru (c);
Zhucaidang ();
A=zhiling ();
if(a> 2)
{
Printf (" \ a ");
}
If (a==1)
{
Printf (" please input the number of terms to store \ n ");
The scanf (" % d ", & amp; k);
Shuru (k, c);
C=c + k;
Paixu (c);
}
Printf (" % s \ n \ t % s ", ciku - & gt; Danci ciku - & gt; Fanyi);
A=zhiling ();
If (a==2)
{
Xianshi (c);
}
Else if (a==3)
{
Xiugai (c, a);
}
Else if (a==4)
{
Shanchu (c, a);
C=c - 1;
}
Else if (a==5)
{
int i;
I=chazhao (c, a);
Printf (" % s % s ", (ciku + I) - & gt; Danci (ciku + I) - & gt; Fanyi);
}
Else if (a==6)
{
Chucun (c);
}
}

  • Related