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

正文內(nèi)容

c語言選修上機(jī)考試復(fù)習(xí)題(已修改)

2025-06-19 13:33 本頁面
 

【正文】 一、單項選擇題略二、改錯題(典型題型)在考生文件夾下,:從低位開始取出長整型變量s中奇數(shù)位上的數(shù),依次構(gòu)成一個新數(shù)放在t中。例如,當(dāng)s中的數(shù)為:7654321時,t中的數(shù)為:7531。請修改并運(yùn)行該程序。include main( ) { long s, t, sl=10。 system(“CLS”)。 printf(\nPlease enter s:)。 scanf(%ld, amp。s)。 /************found************/ t = s / 10。 while ( s 0) { s = s/100。 t = s%10 * sl + t。 /************found************/ sl = sl*100。 } printf(The result is: %ld\n, t)。 }在考生文件夾下,:求一維數(shù)組a中的值為偶數(shù)的元素之和。例如,當(dāng)一維數(shù)組a中的元素為:10,4,2,7,3,12,5,34,5,9 ,程序的輸出應(yīng)為:The result is: 62請修改并運(yùn)行該程序。include include main() { int a[10]={10,4,2,7,3,12,5,34,5,9},i,s。 system(“CLS”)。 s = 0。 for ( i=0。 i10。 i++) /************found************/ if (i % 2 == 0) s = s + a[i]。 /************found************/ print(The result is: %d\n, s)。 }在考生文件夾下,:求一維數(shù)組a中值為偶數(shù)的元素之和。例如,當(dāng)一維數(shù)組a中的元素為:10,4,2,7,3,12,5,34,5,9 ,程序的輸出應(yīng)為:The result is: 62。請修改并運(yùn)行該程序。 include sum ( int arr[ ],int n ) { int i,s。 system(“CLS”)。 s = 0。 for ( i=0。 in。 i++) if (arr[i] % 2 == 0) /************found************/ s = s + i。 return (s)。 } main() { int a[10]={10,4,2,7,3,12,5,34,5,9},i,s。 /************found************/ s = sum( a ,2 )。 printf(The result is: %d\n, s)。 }在考生文件夾下,: 求一維數(shù)組a中的最大元素及其下標(biāo)。例如,當(dāng)一維數(shù)組a中的元素為:1,4,2,7,3,12,5,34,5,9,程序的輸出應(yīng)為:The max is: 34,pos is: 7 。請修改并運(yùn)行該程序。include include main() { int a[10]={1,4,2,7,3,12,5,34,5,9},i,max,pos。 system(“CLS”)。 max = a[0]。 pos = 0。 for ( i=1。 i10。 i++) /************found************/ i
點擊復(fù)制文檔內(nèi)容
教學(xué)教案相關(guān)推薦
文庫吧 www.dybbs8.com
公安備案圖鄂ICP備17016276號-1