近日学校要搞英语单词测试,便制作了这款软件,现在还处于刚开始的开发阶段,后续还会完善问题并持续更新。
源文件里的单词可以自己替换。
#include<iostream>
#include<ctime>
#include<string>
#include<conio.h>
using namespace std;
string En[60], Ch[60];
void start();//开始介绍
void lordi();//加载
void shap();//检阅模式
void simp();//一般模式
void testt();//测试模式
int main()
{
srand((unsigned)time(NULL));
lordi();
start();
return 0;
}
void lordi()
{
En[0] = "unrealistic"; Ch[0] = "adj. 不现实的";
En[1] = "resource"; Ch[1] = "n. 资源";
En[2] = "rewrite"; Ch[2] = "v. 重写";
En[3] = "reconsider"; Ch[3] = "adj. 重新考虑";
En[4] = "state"; Ch[4] = "v. 陈述或说明";
En[5] = "advisor"; Ch[5] = " n.顾问";
En[6] = "relevant"; Ch[6] = "adj. 相关的";
En[7] = "fee"; Ch[7] = " n. 费用";
En[8] = "ranch"; Ch[8] = "n. 牧场";
En[9] = "track"; Ch[9] = "n. 跑道;踪迹";
En[10] = "senior"; Ch[10] = "n. (中学或大学的)毕业班学生";
En[11] = "acre"; Ch[11] = "n. 英亩";
En[12] = "original"; Ch[12] = "adj. 最初的;原始的;原创的";
En[13] = "assemble"; Ch[13] = "adj. 聚集;收集";
En[14] = "freshman/freshperson/fresher"; Ch[14] = "大一学生";
En[15] = "sophomore"; Ch[15] = "大二学生";
En[16] = "junior"; Ch[16] = "大三学生";
En[17] = "senior"; Ch[17] = "大四学生";
En[18] = "extend"; Ch[18] = "v.给予;提供";
En[19] = "transfer"; Ch[19] = "v. 转移";
En[20] = "remarkable"; Ch[20] = "adj. 非凡的;显著的";
En[21] = "potential"; Ch[21] = "n.潜力";
En[22] = "repeal"; Ch[22] = "v.废除;撤销";
En[23] = "transmission"; Ch[23] = "n. 传播";
En[24] = "ultimately"; Ch[24] = "adv. 最终地";
En[25] = "passion"; Ch[25] = "n.热情;激情";
En[26] = "objective"; Ch[26] = "n.目标";
En[27] = "pursue"; Ch[27] = "v. 追求";
En[28] = "faculty"; Ch[28] = "n. 全体教职员工";
En[29] = "retire"; Ch[29] = "v.退休";
En[30] = "maximize"; Ch[30] = "v. 最佳化; 最大化";
En[31] = "diversity"; Ch[31] = "n. 多样性";
En[32] = "dedicated"; Ch[32] = "adj.无私奉献的;专注的";
En[33] = "statistic"; Ch[33] = "n. 统计数字";
En[34] = "cohere"; Ch[34] = "v.连贯;前(理论等)前后一致";
En[35] = "put on"; Ch[35] = "举办(活动)";
En[36] = "raise money"; Ch[36] = "筹款";
En[37] = "at risk"; Ch[37] = "面临危机的;身处险境的";
En[38] = "go back to"; Ch[38] = "追溯到";
En[39] = "in detail"; Ch[39] = "详细地";
En[40] = "hand sth. in"; Ch[40] = "上交";
En[41] = "camp out"; Ch[41] = "露营";
En[42] = "no matter what"; Ch[42] = "不论如何";
En[43] = "hang out"; Ch[43] = "出去玩;闲逛";
En[44] = "sign up"; Ch[44] = "报名参加;登记; 注册";
En[45] = "lead to"; Ch[45] = "促成;导致";
En[46] = "put one’s heart into"; Ch[46] = "全心全意投入";
En[47] = "in terms of"; Ch[47] = "在……方面";
En[48] = "set up"; Ch[48] = "开设;开办";
En[49] = "make sense"; Ch[49] = "说得通;有道理";
En[50] = "in conclusion"; Ch[50] = "总之";
En[51] = "stand out"; Ch[51] = "脱颖而出";
En[52] = "stand in the way of"; Ch[52] = "妨碍";
En[53] = "be open to"; Ch[53] = "对……开放";
En[54] = "take advantage of"; Ch[54] = "利用;占……的便宜";
En[55] = "reach out to"; Ch[55] = "与……交往接触";
En[56] = "get sth. out of sth."; Ch[56] = "从……中获得";
En[57] = "freshman orientation week"; Ch[57] = "新生入学教育周";
En[58] = "learn the ropes"; Ch[58] = "学会做某事";
En[59] = "walk sb. through sth."; Ch[59] = "帮助某人做某事";
}
void start()
{
int b, cc;
b = 1;
do
{
system("cls");
cout << "请选择模式:" << endl << "1---整体检阅(看所有单词)" << endl;
cout << "2---训练模式(60个题目)" << endl;
cout << "3---测试模式(抽取20个题目)" << endl;
cout << "4---退出软件" << endl;
cc = _getch();
if (cc == 49)
{
shap();
}
else if (cc == 50)
{
simp();
}
else if (cc == 51)
{
testt();
}
else if (cc == 52)
{
b = 0;
}
else
{
cout << "你是不是输错了?" << endl;
system("pause");
}
} while (b!=0);
}
void shap()
{
system("cls");
for (int i = 0; i < 60; i++)
{
cout << En[i] << " " << Ch[i] << endl;
}
system("pause");
}
void simp()
{
string yy[4];
int a,b,c,d,e;
for (int i = 0; i < 60; i++)
{
system("cls");
cout << En[i] <<" (按9退出)" << endl;
a = rand() % 4;
d = a;
yy[a] = Ch[i];
if (a == 0)
{
a = rand() % 60;
if (a != i)
{
yy[1] = Ch[a];
}
else if(a<54)
{
a++;
yy[1] = Ch[a];
}
else
{
a = a - 1;
yy[1] = Ch[a];
}
b = rand() % 60;
if (b != i&&b!=a)
{
yy[2] = Ch[b];
}
else if(b<52)
{
b = b + 1;
yy[2] = Ch[b];
}
else
{
b--;
yy[2] = Ch[b];
}
c = rand()%60;
if (c != i && c != a&&c!=b)
{
yy[3] = Ch[c];
}
else if (c < 57)
{
c = c + 1;
yy[3] = Ch[c];
}
else
{
c--;
yy[3] = Ch[c];
}
}
if (a == 1)
{
a = rand() % 60;
if (a != i)
{
yy[0] = Ch[a];
}
else if (a < 57)
{
a++;
yy[0] = Ch[a];
}
else
{
a = a - 1;
yy[0] = Ch[a];
}
b = rand() % 60;
if (b != i && b != a)
{
yy[2] = Ch[b];
}
else if (b < 57)
{
b = b + 1;
yy[2] = Ch[b];
}
else
{
b--;
yy[2] = Ch[b];
}
c = rand() % 60;
if (c != i && c != a && c != b)
{
yy[3] = Ch[c];
}
else if (c < 57)
{
c = c + 1;
yy[3] = Ch[c];
}
else
{
c--;
yy[3] = Ch[c];
}
}
if (a == 2)
{
a = rand() % 60;
if (a != i)
{
yy[0] = Ch[a];
}
else if (a < 57)
{
a++;
yy[0] = Ch[a];
}
else
{
a = a - 1;
yy[0] = Ch[a];
}
b = rand() % 60;
if (b != i && b != a)
{
yy[1] = Ch[b];
}
else if (b < 57)
{
b = b + 1;
yy[1] = Ch[b];
}
else
{
b--;
yy[1] = Ch[b];
}
c = rand() % 60;
if (c != i && c != a && c != b)
{
yy[3] = Ch[c];
}
else if (c < 57)
{
c = c + 1;
yy[3] = Ch[c];
}
else
{
c--;
yy[3] = Ch[c];
}
}
if (a == 3)
{
a = rand() % 60;
if (a != i)
{
yy[0] = Ch[a];
}
else if (a < 57)
{
a++;
yy[0] = Ch[a];
}
else
{
a = a - 1;
yy[0] = Ch[a];
}
b = rand() % 60;
if (b != i && b != a)
{
yy[1] = Ch[b];
}
else if (b < 57)
{
b = b + 1;
yy[1] = Ch[b];
}
else
{
b--;
yy[1] = Ch[b];
}
c = rand() % 60;
if (c != i && c != a && c != b)
{
yy[2] = Ch[c];
}
else if (c < 57)
{
c = c + 1;
yy[2] = Ch[c];
}
else
{
c--;
yy[2] = Ch[c];
}
}
cout << "1 -- "<<yy[0] << " 2 -- " << yy[1] << endl;
cout << "3 -- " << yy[2] << " 4 -- " << yy[3] << endl << "你的答案是: ";
int cc;
cc = _getch();
e = cc - 48;
if (e == d + 1)
{
cout << "正确!" << endl;
system("pause");
system("cls");
}
else if (e == 9)
{
i = 99;
}
else
{
cout << "错误!正确答案是" <<d+1<<"。" << endl;
system("pause");
system("cls");
}
}
}
void testt()
{
int yyu = 0;
for (int i = 0; i < 20; i++)
{
string yy[4];
int a, b, c, d, e,g;
g = rand() % 60;
system("cls");
cout << En[g] << " (按9退出)" << endl;
a = rand() % 4;
d = a;
yy[a] = Ch[g];
if (a == 0)
{
a = rand() % 60;
if (a != g)
{
yy[1] = Ch[a];
}
else if (a < 57)
{
a++;
yy[1] = Ch[a];
}
else
{
a = a - 1;
yy[1] = Ch[a];
}
b = rand() % 60;
if (b != g && b != a)
{
yy[2] = Ch[b];
}
else if (b < 57)
{
b = b + 1;
yy[2] = Ch[b];
}
else
{
b--;
yy[2] = Ch[b];
}
c = rand() % 60;
if (c != g && c != a && c != b)
{
yy[3] = Ch[c];
}
else if (c < 57)
{
c = c + 1;
yy[3] = Ch[c];
}
else
{
c--;
yy[3] = Ch[c];
}
}
if (a == 1)
{
a = rand() % 60;
if (a != g)
{
yy[0] = Ch[a];
}
else if (a < 57)
{
a++;
yy[0] = Ch[a];
}
else
{
a = a - 1;
yy[0] = Ch[a];
}
b = rand() % 60;
if (b != g && b != a)
{
yy[2] = Ch[b];
}
else if (b < 57)
{
b = b + 1;
yy[2] = Ch[b];
}
else
{
b--;
yy[2] = Ch[b];
}
c = rand() % 60;
if (c != g && c != a && c != b)
{
yy[3] = Ch[c];
}
else if (c < 57)
{
c = c + 1;
yy[3] = Ch[c];
}
else
{
c--;
yy[3] = Ch[c];
}
}
if (a == 2)
{
a = rand() % 60;
if (a != g)
{
yy[0] = Ch[a];
}
else if (a < 57)
{
a++;
yy[0] = Ch[a];
}
else
{
a = a - 1;
yy[0] = Ch[a];
}
b = rand() % 60;
if (b != g && b != a)
{
yy[1] = Ch[b];
}
else if (b < 57)
{
b = b + 1;
yy[1] = Ch[b];
}
else
{
b--;
yy[1] = Ch[b];
}
c = rand() % 60;
if (c != g && c != a && c != b)
{
yy[3] = Ch[c];
}
else if (c < 57)
{
c = c + 1;
yy[3] = Ch[c];
}
else
{
c--;
yy[3] = Ch[c];
}
}
if (a == 3)
{
a = rand() % 60;
if (a != g)
{
yy[0] = Ch[a];
}
else if (a < 57)
{
a++;
yy[0] = Ch[a];
}
else
{
a = a - 1;
yy[0] = Ch[a];
}
b = rand() % 60;
if (b != g && b != a)
{
yy[1] = Ch[b];
}
else if (b < 57)
{
b = b + 1;
yy[1] = Ch[b];
}
else
{
b--;
yy[1] = Ch[b];
}
c = rand() % 60;
if (c != g && c != a && c != b)
{
yy[2] = Ch[c];
}
else if (c < 57)
{
c = c + 1;
yy[2] = Ch[c];
}
else
{
c--;
yy[2] = Ch[c];
}
}
cout << "1 -- " << yy[0] << " 2 -- " << yy[1] << endl;
cout << "3 -- " << yy[2] << " 4 -- " << yy[3] << endl << "你的答案是: ";
int cc;
cc = _getch();
e = cc - 48;
if (e == d + 1)
{
yyu++;
system("cls");
}
else if (e == 9)
{
i = 99;
}
else
{
system("cls");
}
}
cout << "你一共做对了" << yyu << "道题目!" << endl;
system("pause");
}