#include?
#include?
#include?
int?main()
{
int?i,j,m;
int?b,num=0,x;
int?s[99],t[99],c[30]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,};
char?d[22][3];
char?h;
char?a[22][100];
strcpy(a[1],"C程序的基本組成單位是函數(shù)\n");
strcpy(a[2],"C程序可以由一個(gè)或多個(gè)函數(shù)組成\n");
strcpy(a[3],"每個(gè)C程序中都必須要有一個(gè)main()函數(shù)\n");
strcpy(a[4],"C程序中注釋部分可以出現(xiàn)在程序中任意合適的地方\n");
strcpy(a[5],"C程序中一行可以寫(xiě)多條語(yǔ)句\n");
strcpy(a[6],"C程序的執(zhí)行總是從main函數(shù)開(kāi)始,在main函數(shù)結(jié)束\n");
strcpy(a[7],"++(i+1);是非法的賦值語(yǔ)句\n");
strcpy(a[8],"用戶標(biāo)識(shí)符中不可以出現(xiàn)中劃線,但可以出現(xiàn)下劃線\n");
strcpy(a[9],"C語(yǔ)言中,Area與area是不同的標(biāo)識(shí)符\n");
strcpy(a[10],"除逗號(hào)運(yùn)算符外,賦值運(yùn)算符的優(yōu)先級(jí)最低\n");
strcpy(a[11],"C語(yǔ)言中,運(yùn)算對(duì)象必須是整型數(shù)據(jù)的運(yùn)算符是%\n");
strcpy(a[12],"表達(dá)式1||2||3||4的值是1\n");
strcpy(a[13],"若變量c為char類(lèi)型,則表達(dá)式(c>=?'a')&&(c<=?'z')?能正確判斷出c為小寫(xiě)字母\n");
strcpy(a[14],"sizeof(float)的值是4\n");
strcpy(a[15],"if(x>y);?是正確的if語(yǔ)句\n");
strcpy(a[16],"在不同的函數(shù)中可以使用相同名字的變量\n");
strcpy(a[17],"C語(yǔ)言中,宏替換沒(méi)有數(shù)據(jù)類(lèi)型限制\n");
strcpy(a[18],"if(x
strcpy(a[20],"C程序不只可以由一個(gè)函數(shù)組成\n");
strcpy(d[1],"t");
strcpy(d[2],"t");
strcpy(d[3],"t");
strcpy(d[4],"t");
strcpy(d[5],"t");
strcpy(d[6],"t");
strcpy(d[7],"t");
strcpy(d[8],"t");
strcpy(d[9],"t");
strcpy(d[10],"t");
strcpy(d[11],"t");
strcpy(d[12],"t");
strcpy(d[13],"t");
strcpy(d[14],"t");
strcpy(d[15],"t");
strcpy(d[16],"t");
strcpy(d[17],"t");
strcpy(d[18],"t");
strcpy(d[19],"t");
strcpy(d[20],"t");
該部分為題庫(kù),錄入問(wèn)題和答案
printf("判斷題,共20道,請(qǐng)回答t或f,勿回答其他答案\n");
printf("\n");
srand((int)time(0));
while(i<20)
{
?b=rand()?%?20?+?1;
//生成一個(gè)在1~20的隨機(jī)數(shù),并隨機(jī)輸出20道題中的任意一道
?for(j=i;j>=0;j--)
?{
?????if(b==s[j])
?????????break;
?}
?if(j<0)
?{
?????s[i]=b;
?????i++;
?}
}
for(i=0;i<20;i++)
{
?x=s[i];
?printf("第%d題:%s\n",i+1,a[x]);
?printf("請(qǐng)輸入答案?:??");
?scanf("%s",&h);
?if(h==d[x][0]||h==d[x][0]-32)
?{
?????printf("答案正確\n");
?????num=num+1;
?????printf("當(dāng)前答對(duì)%d道題\n",num);
?}
?else
?{
?????printf("答案錯(cuò)誤\n");
?????printf("正確答案為:%c\n",d[x][0]);
?????printf("當(dāng)前答對(duì)%d道題\n",num);
?????c[i]=i+1;
?}
?printf("\n");
}
printf("最終得分為:%d\n",num*5);
printf("正確率為:%d%\n",num*100/20);
printf("答錯(cuò)題目為:");
for(i=0;i<=20;i++)
{
?if(c[i]!=0)
?printf("第%d道??",c[i]);
}
return?0;
}
在最后輸出得分與正確率,以及答錯(cuò)的題目序號(hào)。
你是否還在尋找穩(wěn)定的海外服務(wù)器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機(jī)房具備T級(jí)流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確流量調(diào)度確保服務(wù)器高可用性,企業(yè)級(jí)服務(wù)器適合批量采購(gòu),新人活動(dòng)首月15元起,快前往官網(wǎng)查看詳情吧
文章名稱(chēng):制作一個(gè)簡(jiǎn)單答題系統(tǒng)-創(chuàng)新互聯(lián)
鏈接地址:http://jinyejixie.com/article14/dpoege.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站制作、網(wǎng)站制作、網(wǎng)頁(yè)設(shè)計(jì)公司、網(wǎng)站設(shè)計(jì)、App設(shè)計(jì)、全網(wǎng)營(yíng)銷(xiāo)推廣
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容