- 分享
- 0
- 人气
- 0
- 主题
- 18
- 帖子
- 521
- UID
- 194055
- 积分
- 320
- 阅读权限
- 15
- 注册时间
- 2009-1-21
- 最后登录
- 2018-5-8
- 在线时间
- 3267 小时
|
回复 5# Super-Tomato
#include<stdio.h>
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<time.h>
#include<windows.h>
#include <string.h>
void quiz(void);
void quizquestion1(void);
void quizquestion2(void);
void quizquestion3(void);
void quizquestion4(void);
void quizquestion5(void);
void quizquestion6(void);
void quizquestion7(void);
void quizquestion8(void);
void quizquestion9(void);
void quizquestion10(void);
void quizquestion11(void);
void quizquestion12(void);
void quizquestion13(void);
void quizquestion14(void);
void quizquestion15(void);
void quizquestion16(void);
void quizquestion17(void);
void quizquestion18(void);
void quizquestion19(void);
void quizquestion20(void);
{
char answer;
char quizback,choice,score=0;
int question;
system("cls");
printf("\n\nThis is a CHEMISTRY QUIZ\n");
printf("**********************\n\n");
printf("Do you want to start now(Y/N) ");
scanf_s("%c",&choice);
if(choice=='y')
{
//
system("cls");
printf("\n+++++++++++++++++++++++++++++++++\n");
printf("+WELCOME TO CHEMISTRY QUIZ WORLD+\n");
printf("+++++++++++++++++++++++++++++++++\n");
printf("\t*****************************************************************************************\n");
printf("\t* Welcome to CHEMY's CHEMISTRY QUIZ... Are you ready???Let's go! Wish you good luck! *\n");
printf("\t*****************************************************************************************\n");
//Q1
void quizquestion1(void)
{
srand(time(NULL));
quizquestion1=rand()%20+1;
switch (quizquestion1)
{void quizquestion1()
{
bool quizquestion1 = true;
while(quizquestion1)
{
switch(quizquestion1)
{
case 1:quizquestion1 = false;break;
case 2:quizquestion1 = false;break;
case 3:quizquestion1 = false;break;
case 4:quizquestion1 = false;break;
case 5:quizquestion1 = false;break;
case 6:quizquestion1 = false;break;
case 7:quizquestion1 = false;break;
case 8:quizquestion1 = false;break;
case 9:quizquestion1 = false;break;
case 11:quizquestion1 = false;break;
case 12:quizquestion1 = false;break;
case 13:quizquestion1 = false;break;
case 14:quizquestion1 = false;break;
case 15:quizquestion1 = false;break;
case 16:quizquestion1 = false;break;
case 17:quizquestion1 = false;break;
case 18:quizquestion1 = false;break;
case 19:quizquestion1 = false;break;
case 20:quizquestion1 = false;break;
}
}
}
//Q2
void quizquestion2(void)
srand(time(NULL));
quizquestion2=rand()%20+1;
switch (quizquestion2)
{void quizquestion2()
{
bool quizquestion2 = true;
while(quizquestion2)
{
switch(quizquestion2)
{
case 1:quizquestion2 = false;break;
case 2:quizquestion2 = false;break;
case 3:quizquestion2 = false;break;
case 4:quizquestion2 = false;break;
case 5:quizquestion2 = false;break;
case 6:quizquestion2 = false;break;
case 7:quizquestion2 = false;break;
case 8:quizquestion2 = false;break;
case 9:quizquestion2 = false;break;
case 11:quizquestion2 = false;break;
case 12:quizquestion2 = false;break;
case 13:quizquestion2 = false;break;
case 14:quizquestion2 = false;break;
case 15:quizquestion2 = false;break;
case 16:quizquestion2 = false;break;
case 17:quizquestion2 = false;break;
case 18:quizquestion2 = false;break;
case 19:quizquestion2 = false;break;
case 20:quizquestion2 = false;break;
}
}
}
接下去都是一样的重复10次,可是好像没有用的感觉 |
|