帮忙纠正错误了,兄弟们!
#include<stdio.h>#include<stdlib.h>
#include<time.h>
#define N 10 /*扩展宏定义*/
int random(int); /*随机变量函数*/
void duanyu(); //函数声明
void juzi();
void main() //函数定义
{
char str[5]; //变量说明
printf("xian zai xue xi kai shi ,qing xiao peng you zuo hao zhunbei!\n");
printf("zhun bei hao le ma ?\n");
printf("yes ? no ?\n");
gets(str);
if(strcmp(str,"yes")==0)
{
void danci();
}
else
{
exit(1);
}
}
void danci()
{
//变量说明
int i;
int jinji;
int count=0;
char wenti[N][10];
char daan[N][10];
long wentiweizhi;
char shuru[10];
//变量定义,函数输入部分
wenti[N][10]={"banana","apple","follow","come","go","here","there","he","she","look"};
daan[N][10]={"香蕉","苹果","跟随","来","去","这里","那里","他","她","看"};
for(i=0;i<10;i++) //测试部分
{
wentiweizhi=random(N+1); //随机数发生器随机取数
printf("%50c",wenti[wentiweizhi]);
printf("qing ba ying wen dan ci fan yi cheng han yu\n");
gets(shuru);
if(strcmp(daan[wentiweizhi],shuru)==0)
{
printf("ni tai bang le,ji xu jia you!\n");
count ++;
}
else
printf("da an cuo wu ,ji xu jia you o!");
}
jinji=count%7;//10道题回答正确8道题,才能晋级
if(jinji>0)
{
goto void duanyu();
}
else
{
printf("xiao peng you ni dan ci bu guo guan ,hai yao ji xu bei dan ci");
}
}
void duanyu()
{
int i;
int jinji;
int count=0;
char wenti[N][30];
char daan[N][30];
long wentiweizhi;
char shuru[30];
wenti[N][30]={"look at ","add to ","admit into ","all but",
"at rest","aware of","come on","come acorss","laugh at","look after"};
daan[N][30]={"看一看","增加","允许入内","几乎","静止不动",
"意识到","加油","遇见","嘲笑","照顾"};
for(i=0;i<10;i++)
{
wentiweizhi=random(N+1);
printf("%50c",wenti[wentiweizhi]);
printf("qing ba han yu duan yu ci fan yi cheng ying yu\n");
gets(shuru);
if(strcmp(daan[wentiweizhi],shuru)==0)
{
printf("ni tai bang le,ji xu jia you!\n");
count ++;
}
else
printf("da an cuo wu ,ji xu jia you o!");
}
jinji=count%7;//10道题回答正确8道题,才能晋级
if(jinji>0)
{
printf("ni tai bang le,ji xu jia you! xia yi guan shi duan yu xue xi\n");
duanyu();
}
else
{
printf("xiao peng you ni de duan yu bu guo guan ,chong xin cong can ci\n");
goto void danci;
}
}
void juzi()
{
int i,j;
int jinji;
int count=0;
char wenti[N][50];
char daan[N][50];
long wentiweizhi;
char shuru[50];
wenti[N][50]={"I am a boy.","She is a girl"," See you later!","Thank you!",
"How are you?","Me too!","Welcome to ping ding shan",
"Nice to meet you !","let us go!","What are you doing?"};
daan[N][50]={"我是一个男孩","她是一个女孩","再见","谢谢你","你好吗",
"我也是","欢迎来到平顶山",
"很高兴见到你","我们走","你在干什么"};
for(i=0;i<10;i++)
{
wentiweizhi=random(N+1);
printf("%50c",wenti[wentiweizhi]);
printf("qing gen ju ying wen ti shi xie chu xiang ying de hui da");
gets(shuru);
if(strcmp(daan[wentiweizhi],shuru)==0)
{
printf("ni tai bang le,ji xu jia you!\n");
count ++;
}
else
printf("da an cuo wu ,ji xu jia you o!");
}
jinji=count%7;//10道题回答正确8道题,才能晋级
if(jinji>0)
{
printf("congratulations!!!!!!\n");
}
else
{
printf("xiao peng you ni de duan yu bu guo guan ,chong xin cong can ci");
goto void duanyu;
}
}
调试结果:
--------------------Configuration: 小学英语教学系统 - Win32 Debug--------------------
Compiling...
小学英语教学.c
D:\标准c\小学英语教学系统\小学英语教学.c(19) : warning C4013: 'strcmp' undefined; assuming extern returning int
D:\标准c\小学英语教学系统\小学英语教学.c(41) : error C2059: syntax error : '{'
D:\标准c\小学英语教学系统\小学英语教学.c(42) : error C2059: syntax error : '{'
D:\标准c\小学英语教学系统\小学英语教学.c(66) : error C2059: syntax error : 'type'
D:\标准c\小学英语教学系统\小学英语教学.c(85) : error C2059: syntax error : '{'
D:\标准c\小学英语教学系统\小学英语教学.c(87) : error C2059: syntax error : '{'
D:\标准c\小学英语教学系统\小学英语教学.c(118) : error C2059: syntax error : 'type'
D:\标准c\小学英语教学系统\小学英语教学.c(133) : error C2059: syntax error : '{'
D:\标准c\小学英语教学系统\小学英语教学.c(136) : error C2059: syntax error : '{'
D:\标准c\小学英语教学系统\小学英语教学.c(167) : error C2059: syntax error : 'type'
执行 cl.exe 时出错.
小学英语教学.obj - 1 error(s), 0 warning(s)