C語言課程設(shè)計(jì)小學(xué)生四則運(yùn)算_第1頁
C語言課程設(shè)計(jì)小學(xué)生四則運(yùn)算_第2頁
C語言課程設(shè)計(jì)小學(xué)生四則運(yùn)算_第3頁
C語言課程設(shè)計(jì)小學(xué)生四則運(yùn)算_第4頁
C語言課程設(shè)計(jì)小學(xué)生四則運(yùn)算_第5頁
已閱讀5頁,還剩5頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、#include"stdio.h"#include"stdlib.h"void main() int a,b,c,d,e,f,g,t; printf("*歡迎使用!*n"); printf("n"); printf("1.加法運(yùn)算n"); printf("2.減法運(yùn)算n"); printf("3.乘法運(yùn)算n"); printf("4.除法運(yùn)算n"); printf("*請選擇運(yùn)算類型:"); scanf("

2、%d",&a); while(a<1|a>4) printf("輸入錯(cuò)誤,請重新輸入"); scanf("%d",&a); if(a=1) printf("5,一位數(shù)加一位數(shù)n"); printf("6,一位數(shù)加兩位數(shù)n"); printf("7,兩位數(shù)加兩位數(shù)n"); printf("*請輸入題型:"); scanf("%d",&a); while(a<5|a>7) printf("輸入

3、錯(cuò)誤,請重新輸入"); scanf("%d",&a); if(a=5) loop:b=rand()%10; c=rand()%10; d=b+c; printf("%d+%d=?n",b,c); printf("請輸入答案:"); scanf("%d",&e); while(e!=d) printf("回答錯(cuò)誤,請重做"); printf("%d+%d=?n",b,c); printf("請輸入答案:"); scanf("

4、;%d",&e); printf("回答正確!是否做下一題?n"); printf("輸入0表示是,輸入1表示否n"); scanf("%d",&f); if(f=0) goto loop; if(f=1) printf("歡迎再次使用!"); if(a=6) loo: b=rand()%10; c=rand()%100; if (c<10) c=c+10; d=b+c; printf("%d+%d=?n",b,c); printf("請輸入答案:&qu

5、ot;); scanf("%d",&e); while(e!=d) printf("回答錯(cuò)誤,請重做"); printf("%d+%d=?n",b,c); printf("請輸入答案:"); scanf("%d",&e); printf("回答正確!是否做下一題?n"); printf("輸入0表示是,輸入1表示否n"); scanf("%d",&f); if(f=0) goto loo; if(f=1) pri

6、ntf("歡迎再次使用!"); if(a=7) loog:b=rand()%100; c=rand()%100; if(c<10) c=c+10; if(b<10) b=b+10; d=b+c; printf("%d+%d=?n",b,c); printf("請輸入答案:"); scanf("%d",&e); while(e!=d) printf("回答錯(cuò)誤,請重做"); printf("%d+%d=?n",b,c); printf("請輸入答案

7、:"); scanf("%d",&e); printf("回答正確!是否做下一題?n"); printf("輸入0表示是,輸入1表示否n"); scanf("%d",&f); if(f=0)goto loog; if(f=1) printf("歡迎再次使用!"); if(a=2) printf("5,一位數(shù)減一位數(shù)n"); printf("6,兩位數(shù)減一位數(shù)n"); printf("7,兩位數(shù)減兩位數(shù)n");

8、printf("請輸入題型:"); scanf("%d",&a); while(a<5|a>7) printf("輸入錯(cuò)誤,請重新輸入"); scanf("%d",&a); if(a=5) car: b=rand()%10; c=rand()%10; d=b-c; printf("%d-%d=?n",b,c); printf("請輸入答案:"); scanf("%d",&e); while(e!=d) printf(&q

9、uot;回答錯(cuò)誤,請重做"); printf("%d-%d=?n",b,c); printf("請輸入答案:"); scanf("%d",&e); printf("回答正確!是否做下一題?n"); printf("輸入0表示是,輸入1表示否n"); scanf("%d",&f); if(f=0)goto car; if(f=1) printf("歡迎再次使用!"); if(a=6) truck:b=rand()%100; if(b

10、<10) b=b+10; c=rand()%10; d=b-c; printf("%d-%d=?n",b,c); printf("請輸入答案:"); scanf("%d",&e); while(e!=d) printf("回答錯(cuò)誤,請重做"); printf("%d-%d=?n",b,c); printf("請輸入答案:"); scanf("%d",&e); printf("回答正確!是否做下一題?n"); pri

11、ntf("輸入0表示是,輸入1表示否n"); scanf("%d",&f); if(f=0)goto truck; if(f=1) printf("歡迎再次使用!"); if(a=7) boat:b=rand()%100; if(b<10) b=b+10; c=rand()%100; if(c<10) c=c+10; d=b-c; printf("%d-%d=?n",b,c); printf("請輸入答案:"); scanf("%d",&e); w

12、hile(e!=d) printf("回答錯(cuò)誤,請重做"); printf("%d-%d=?n",b,c); printf("請輸入答案:"); scanf("%d",&e); printf("回答正確!是否做下一題?n"); printf("輸入0表示是,輸入1表示否n"); scanf("%d",&f); if(f=0)goto boat; if(f=1) printf("歡迎再次使用!"); if(a=3) pri

13、ntf("5,一位數(shù)乘一位數(shù)n"); printf("6,一位數(shù)乘兩位數(shù)n"); printf("7,兩位數(shù)乘兩位數(shù)n"); printf("請輸入題型:"); scanf("%d",&a); while(a<5|a>7) printf("輸入錯(cuò)誤,請重新輸入"); scanf("%d",&a); if(a=5) life:b=rand()%10; c=rand()%10; d=b*c; printf("%d*%d=?

14、n",b,c); printf("請輸入答案:"); scanf("%d",&e); while(e!=d) printf("回答錯(cuò)誤,請重做"); printf("%d*%d=?n",b,c); printf("請輸入答案:"); scanf("%d",&e); printf("回答正確!是否做下一題?n"); printf("輸入0表示是,輸入1表示否n"); scanf("%d",&a

15、mp;f); if(f=0)goto life; if(f=1) printf("歡迎再次使用!"); if(a=6) shame:b=rand()%100; if(b<10) b=b+10; c=rand()%10; d=b*c; printf("%d*%d=?n",b,c); printf("請輸入答案:"); scanf("%d",&e); while(e!=d) printf("回答錯(cuò)誤,請重做"); printf("%d*%d=?n",b,c); pr

16、intf("請輸入答案:"); scanf("%d",&e); printf("回答正確!是否做下一題?n"); printf("輸入0表示是,輸入1表示否n"); scanf("%d",&f); if(f=0)goto shame; if(f=1) printf("歡迎再次使用!"); if(a=7) yeah:b=rand()%100; c=rand()%100; if(b<10) b=b+10; if(c<10) c=c+10; d=b*c;

17、 printf("%d*%d=?n",b,c); printf("請輸入答案:"); scanf("%d",&e); while(e!=d) printf("回答錯(cuò)誤,請重做"); printf("%d*%d=?n",b,c); printf("請輸入答案:"); scanf("%d",&e); printf("回答正確!是否做下一題?n"); printf("輸入0表示是,輸入1表示否n"); sc

18、anf("%d",&f); if(f=0)goto yeah; if(f=1) printf("歡迎再次使用!"); if(a=4) printf("5,一位數(shù)除一位數(shù)n"); printf("6,兩位數(shù)除一位數(shù)n"); printf("7,兩位數(shù)除兩位數(shù)n"); printf("請輸入題型:"); scanf("%d",&a); while(a<5|a>7) printf("輸入錯(cuò)誤,請重新輸入"); sc

19、anf("%d",&a); if(a=5) hit: b=rand()%10; c=rand()%10; if (b>c) g=b%c; if (g!=0) b=b-g; d=b/c; printf("%d/%d=?n",b,c); else d=b/c; printf("%d/%d=?n",b,c); if (c>b) g=c%b; if (g!=0) c=c-g; t=c;c=b;b=t; d=b/c; printf("%d/%d=?n",b,c); else t=c;c=b;b=t; d=

20、b/c; printf("%d/%d=?n",b,c); printf("請輸入答案:"); scanf("%d",&e); while(e!=d) printf("回答錯(cuò)誤,請重做"); printf("%d/%d=?n",b,c); printf("請輸入答案:"); scanf("%d",&e); printf("回答正確!是否做下一題?n"); printf("輸入0表示是,輸入1表示否n")

21、; scanf("%d",&f); if(f=0)goto hit; if(f=1) printf("歡迎再次使用!"); if(a=6) haha:b=rand()%100; c=rand()%10; if(b<10) b=b+10; g=b%c; if (g!=0) b=b-g; d=b/c; printf("%d/%d=?n",b,c); printf("請輸入答案:"); scanf("%d",&e); while(e!=d) printf("回答錯(cuò)誤,請重做"); printf("%d/%d=?n",b,c); printf("請輸入答案:"); scanf("%d",&e); printf("回答正確!是否做下一題?n"); printf("輸入0表示是,輸入1表示否n"); scanf("%d",&f); if(f=

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論