freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

c語言基本編程題-資料下載頁

2025-03-24 04:48本頁面
  

【正文】 for (j=0。 j3。 j++) scanf(“%d”,amp。 a[i][j])。 min=a[0][0]。 m=0。 n=0。 for (i=0。 i4。 i++) for (j=0。 j3。 j++) if (a[i][j]min){min= a[i][j]。 m=i。 n=j。}printf(the min is %d\n, min)。printf(posion is %d %d \n, m,n)。}33.編程實現(xiàn)如下功能:從鍵盤輸入一行字符,統(tǒng)計其中大寫英文字符,小寫英文字符和其他字符的個數(shù)。include include define ARR_SIZE 80void main(){ char str[ARR_SIZE]。 int len, i, letter = 0, digit = 0, space = 0, others = 0。 printf(Please input a string:)。 gets(str)。 len = strlen(str)。 for (i=0。 ilen。 i++){ if (str[i] = 39。a39。 amp。amp。 str[i] = 39。z39。 || str[i] = 39。A39。 amp。amp。 str[i] = 39。Z39。) letter ++。 /*統(tǒng)計英文字符*/ else if (str[i] = 39。039。 amp。amp。 str[i] = 39。939。 ) digit ++。 /*統(tǒng)計數(shù)字字符*/ else others ++。 /*統(tǒng)計其它字符的個數(shù)*/ } printf(English character: %d\n, letter)。 printf(digit character: %d\n, digit)。 printf(other character: %d\n, others)。}*3猜數(shù)游戲。系統(tǒng)隨機(jī)產(chǎn)生一個整數(shù),通過鍵盤輸入數(shù)據(jù)猜數(shù),猜對為止,并要求統(tǒng)計猜的次數(shù)。注:rand()函數(shù)可以產(chǎn)生0~32767間的正整數(shù)。include include void main(){ int magic。 int guess。 int counter。 magic = rand() % 100 + 1。 counter = 0。 do{ printf(Please guess a magic number:)。 scanf(%d, amp。guess)。 counter ++。 if (guess magic) printf(Wrong!Too high!\n)。 else if (guess magic) printf(Wrong!Too low!\n)。 }while (guess != magic)。 printf(Right!\n)。 printf(counter = %d\n, counter)。 },以輸入負(fù)數(shù)或零結(jié)束,分別求最重和最輕的體重,并計算平均體重。 include void main() { int n=0。 float weight,max=0,min=10,sum=0,ave。 printf(“please input the weight:”)。 scanf(“%f”,amp。 weight)。 while(weight0) { sum=weight+sum。 n++。 if (weightmin) min=weight。 else if(weightmax) max=weight。 scanf(“%f”,amp。 weight)。}if (n0){ ave=sum/n。 printf(maxweight = %f\n , max)。 printf(minweight = %f\n, min)。printf(ave = %f\n,ave)。 else printf(NO VALID DATA”)。}40. 編寫程序,其中自定義一函數(shù),用來判斷一個整數(shù)是否為素數(shù),主函數(shù)輸入一個數(shù),輸出是否為素數(shù)。include include int IsPrimeNumber(int number){ int i。 if (number = 1) return 0。 for (i=2。 isqrt(number)。 i++) { if ((number % i) == 0) return 0。 } return 1。} void main(){ int n。 printf(“Please input n:”)。 scanf(“%d”,amp。n)。 if(IsPrimeNumber(n)) printf(“\n%d is a Prime Number”,n)。 else printf(“\n%d is not a Prime Number”,n)。}第 17 頁 共 17
點擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1