c语言出错英语显示怎么看,C语言程序设计 教小学生英语 里面有代码运行错误,怎么改...
該樓層疑似違規(guī)已被系統(tǒng)折疊?隱藏此樓查看此樓
編了一個(gè)星期了,找了好多錯(cuò)誤原因沒(méi)找到,我好笨啊
下面是我代碼
#include
#include
#include
#include
#define SIZE 100//聲明函數(shù),結(jié)構(gòu)
void zero();//主顯示界面
void select();//選擇界面
void save();//保存界面函數(shù)
void save1();//保存單詞函數(shù)
void save2();//保存短語(yǔ)函數(shù)
void save3();//保存短句函數(shù)
void see();//查看詞庫(kù)界面
void see1();//查看單詞詞庫(kù)
void see2();//查看短語(yǔ)詞庫(kù)
void see3();//查看短句詞庫(kù)
void one();//學(xué)習(xí)單詞函數(shù)
void two();//學(xué)習(xí)短語(yǔ)函數(shù)
void three();//學(xué)習(xí)短句函數(shù)
struct word_list
{ char a1[10];
char b1[10];
}word[SIZE];
struct phrase_list
{ char a2[20];
char b2[20];
}phrase[SIZE];
struct sentence_list
{ char a3[100];
char b3[100];
}sentence[SIZE];
//定義函數(shù)
void main()
{zero();
select();}
void zero()
{printf("\n");
printf("\n\n\n");
printf("\t| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");
printf("\t| |\n");
printf("\t| |\n");
printf("\t| ------快-樂(lè)-學(xué)-習(xí)——快-樂(lè)-成-長(zhǎng)----- |\n");
printf("\t| |\n");
printf("\t| love me, love English! |\n");
printf("\t| |\n");
printf("\t| |\n");
printf("\t| 1.開(kāi)始學(xué)習(xí) |\n");
printf("\t| |\n");
printf("\t| 2.擴(kuò)大詞庫(kù) |\n");
printf("\t| |\n");
printf("\t| 3.查看詞庫(kù) |\n");
printf("\t| |\n");
printf("\t| 4.退出系統(tǒng) |\n");
printf("\t| |\n");
printf("\t| |\n");
printf("\t| |\n");
printf("\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");
}
void select()
{ int a;
printf("\t\t 請(qǐng)選擇: ");
scanf("%d",&a);
switch(a)
{
case 1:one();break;
case 2:save();break;
case 3:see();break;
case 4:exit(0);
default: printf("error\n");
}
}
void save()
{int b;
printf("\n");
printf("\n");
printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");
printf("\t\t| |\n");
printf("\t\t| ------快-樂(lè)-學(xué)-習(xí)—&&&—快-樂(lè)-成-長(zhǎng)----- |\n");
printf("\t\t| |\n");
printf("\t\t| !!!love me, love english!!! |\n");
printf("\t\t| |\n");
printf("\t\t| 1.記錄單詞 |\n");
printf("\t\t| |\n");
printf("\t\t| 2.記錄詞組 |\n");
printf("\t\t| |\n");
printf("\t\t| 3.記錄句子 |\n");
printf("\t\t| |\n");
printf("\t\t| 4.返回 |\n");
printf("\t\t| |\n");
printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");
printf("\t\t 請(qǐng)輸入: ");
scanf("\n %d",&b);
switch(b)
{
case 1:save1();break;
case 2:save2();break;
case 3:save3();break;
case 4:zero(); select();break;
default: printf("error\n");
}
}
void save1()
{int i,j,m1;
FILE *fp1,*fi1;
if((fp1=fopen("word_list","r"))==NULL)
{fp1=fopen("word_list","wb");fclose(fp1);}
if((fi1=fopen("c1","r"))==NULL)
{m1=0;
fi1=fopen("c1","wb");
fwrite(&m1,sizeof(int),1,fi1);
fclose(fi1);}
if((fi1=fopen("c1","rb"))!=NULL)
{
fi1=fopen("c1","rb");
fread(&m1,sizeof(int),1,fi1);
i=m1;
}
for(i;i<=SIZE;i++)
{if(m1>=(SIZE-1))
{printf("\n---------------------------已存滿(mǎn),不能存入數(shù)據(jù)--------------------------");
break;}
else
{printf("請(qǐng)輸入英文單詞:");
getchar();
gets(word[i].a1);
printf("\n請(qǐng)輸入中文詞語(yǔ):");
gets(word[i].b1);
if((fp1=fopen("word_list","ab"))==NULL)
{
printf("cannot open file\n");
exit(0);
}
if(fwrite(&word[i],sizeof(struct word_list),1,fp1)!=1)
printf("file write error\n");
fclose(fp1);
m1=m1+1;
if((fi1=fopen("c1","wb"))==NULL)
{
printf("cannot open file\n");
exit(0);
}
if(fwrite(&m1,sizeof(int),1,fi1)!=1)
printf("file write error\n");
fclose(fi1);
printf("\t\t \n");
printf("\t\t \n");
printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");
printf("\t\t| |\n");
printf("\t\t|----------記錄成功!是否繼續(xù)記錄單詞-----------|\n");
printf("\t\t| |\n");
printf("\t\t| |\n");
printf("\t\t| 1.繼續(xù)--- |\n");
printf("\t\t| |\n");
printf("\t\t| 2.退出--- |\n");
printf("\t\t| |\n");
printf("\t\t| |\n");
printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");
printf("\t\t 請(qǐng)輸入: ");
scanf("%d",&j);
if(j==1) ;
else if(j==2)
break;
}}
zero();
select();
}
void save2()
{int i,j,m2;
FILE *fp2,*fi2;
if((fp2=fopen("phrase_list","r"))==NULL)
{fp2=fopen("phrase_list","wb");fclose(fp2);}
if((fi2=fopen("c2","r"))==NULL)
{m2=0;
fi2=fopen("c2","wb");
fwrite(&m2,sizeof(int),1,fi2);
fclose(fi2);}
if((fi2=fopen("c2","rb"))!=NULL)
{
fi2=fopen("c2","rb");
fread(&m2,sizeof(int),1,fi2);
i=m2;
}
for(i;i<=SIZE;i++)
{if(m2>=(SIZE-1))
{printf("\n---------------------------已存滿(mǎn),不能存入數(shù)據(jù)--------------------------");
break;}
else
{printf("請(qǐng)輸入英文短語(yǔ):");
getchar();
gets(phrase[i].a2);
printf("\n請(qǐng)輸入中文短語(yǔ):");
gets(phrase[i].b2);
if((fp2=fopen("phrase_list","ab"))==NULL)
{
printf("cannot open file\n");
exit(0);
}
if(fwrite(&phrase[i],sizeof(struct phrase_list),1,fp2)!=1)
printf("file write error\n");
fclose(fp2);
m2=m2+1;
if((fi2=fopen("c2","wb"))==NULL)
{
printf("cannot open file\n");
exit(0);
}
if(fwrite(&m2,sizeof(int),1,fi2)!=1)
printf("file write error\n");
fclose(fi2);
printf("\t\t \n");
printf("\t\t \n");
printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");
printf("\t\t| |\n");
printf("\t\t|----------記錄成功!是否繼續(xù)記錄單詞-----------|\n");
printf("\t\t| |\n");
printf("\t\t| |\n");
printf("\t\t| 1.繼續(xù)--- |\n");
printf("\t\t| |\n");
printf("\t\t| 2.退出--- |\n");
printf("\t\t| |\n");
printf("\t\t| |\n");
printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");
printf("\t\t 請(qǐng)輸入: ");
scanf("%d",&j);
if(j==1) ;
else if(j==2)
break;
}}
zero();
select();
}
void save3()
{int i,j,m3;
FILE *fp3,*fi3;
if((fp3=fopen("sentence_list","r"))==NULL)
{fp3=fopen("sentence_list","wb");fclose(fp3);}
if((fi3=fopen("c3","r"))==NULL)
{m3=0;
fi3=fopen("c3","wb");
fwrite(&m3,sizeof(int),1,fi3);
fclose(fi3);}
if((fi3=fopen("c3","rb"))!=NULL)
{
fi3=fopen("c3","rb");
fread(&m3,sizeof(int),1,fi3);
i=m3;
}
for(i;i<=SIZE;i++)
{if(m3>=(SIZE-1))
{printf("\n---------------------------已存滿(mǎn),不能存入數(shù)據(jù)--------------------------");
break;}
else
{printf("請(qǐng)輸入英文短句:");
getchar();
gets(sentence[i].a3);
printf("\n請(qǐng)輸入中文短句:");
gets(sentence[i].b3);
if((fp3=fopen("sentence_list","ab"))==NULL)
{
printf("cannot open file\n");
exit(0);
}
if(fwrite(&sentence[i],sizeof(struct sentence_list),1,fp3)!=1)
printf("file write error\n");
fclose(fp3);
m3=m3+1;
if((fi3=fopen("c3","wb"))==NULL)
{
printf("cannot open file\n");
exit(0);
}
if(fwrite(&m3,sizeof(int),1,fi3)!=1)
printf("file write error\n");
fclose(fi3);
printf("\t\t \n");
printf("\t\t \n");
printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");
printf("\t\t| |\n");
printf("\t\t|----------記錄成功!是否繼續(xù)記錄單詞-----------|\n");
printf("\t\t| |\n");
printf("\t\t| |\n");
printf("\t\t| 1.繼續(xù)--- |\n");
printf("\t\t| |\n");
printf("\t\t| 2.退出--- |\n");
printf("\t\t| |\n");
printf("\t\t| |\n");
printf("\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");
printf("\t\t 請(qǐng)輸入: ");
scanf("%d",&j);
if(j==1) ;
else if(j==2)
break;
}}
zero();
select();
}
總結(jié)
以上是生活随笔為你收集整理的c语言出错英语显示怎么看,C语言程序设计 教小学生英语 里面有代码运行错误,怎么改...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Vue制作图片翻面效果
- 下一篇: 数云融合丨知识图谱在烟草零售数字化转型中