![2022年度C語言考試系統(tǒng)題庫_第1頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/5/04d4252a-1d3c-428d-a7ea-043dc5a22bdc/04d4252a-1d3c-428d-a7ea-043dc5a22bdc1.gif)
![2022年度C語言考試系統(tǒng)題庫_第2頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/5/04d4252a-1d3c-428d-a7ea-043dc5a22bdc/04d4252a-1d3c-428d-a7ea-043dc5a22bdc2.gif)
![2022年度C語言考試系統(tǒng)題庫_第3頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/5/04d4252a-1d3c-428d-a7ea-043dc5a22bdc/04d4252a-1d3c-428d-a7ea-043dc5a22bdc3.gif)
![2022年度C語言考試系統(tǒng)題庫_第4頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/5/04d4252a-1d3c-428d-a7ea-043dc5a22bdc/04d4252a-1d3c-428d-a7ea-043dc5a22bdc4.gif)
![2022年度C語言考試系統(tǒng)題庫_第5頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/5/04d4252a-1d3c-428d-a7ea-043dc5a22bdc/04d4252a-1d3c-428d-a7ea-043dc5a22bdc5.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、#include <conio.h>#include <stdio.h>void main() int arr10=11,4,2,7,3,12,5,34,5,9,i; int s=0; /*found*/ for ( i=0; i<10; i+) /*found*/ if (arri % 2 = 1) s = s + arri; printf("The result is: %dn", s); #include "stdio.h"#include "string.h"void main( ) char s
2、10; unsigned i;/*found*/ int n=0; scanf("%s",s);/*found*/for(i=0;i<strlen(s);i+) n=n*10+si-'0' printf("n=%ldn",n);#include <conio.h> #include <stdio.h> double average( int arr , int n ) int k=0,i; double s; s = 0; for ( i=0 ;i<n; i+) /*found*/ if (arri %
3、 2 = 1) s = s + arri; k+; return (s/k) ; void main() int a12=10,4,2,7,3,12,5,34,5,9,21,18; double s; /*found*/ s = average(a,12); printf("The result is: %.2fn", s); #include <math.h> #include <conio.h> #include <stdio.h> void main() int x,y,t,max,min,i,n1,n2; printf("
4、;Please enter two numbers:"); scanf("%d,%d",&x,&y); if(x > y) t = x; x = y; y = t; n1=x; n2=y; t = n2 % n1; /*found*/ while( n1>n2 ) n2 = n1 ; n1 = t ; t = n2 % n1; /*found*/ max = t; min = x * y / max ; printf("max is : %dn",max); printf("min is : %dn&quo
5、t;,min); #include <stdio.h> #define N 3 int fun(int aNN) int min; /*begin*/ int i,j; min=a00; for(i=0;i<N;i+) for(j=0;j<N;j+) if(aij<min)min=aij; /*end*/ return min; void main() void NONO( );/函數(shù)聲明 int aNN=-1,2,3,4,9,5,7,8,6; int i,j,min; printf("array is:n"); for(i=0;i<N;
6、i+) for(j=0;j<N;j+) printf("%5d",aij); printf("n"); min=fun(a); printf("Result is: %dn",min); NONO( ); void NONO( ) FILE *fr,*fw; int i,j,k,m,aNN; fr=fopen("D:exam05910327PROGIN.DAT","r"); fw=fopen("D:exam05910327PROGOUT.DAT","w&quo
7、t;); for(i=1;i<=5;i+) for(j=0;j<N;j+) for(k=0;k<N;k+) fscanf(fr,"%d",&ajk); fprintf(fw,"%4d",ajk); fprintf(fw,"Min = %dn",fun(a); fclose(fr); fclose(fw); #include <conio.h> #include <stdio.h> void main() int a33=4,4,34,37,3,12,5,6,5,i,j,max,min;
8、 max = min = a00; for ( i=0; i<3; i+) /*found*/ for ( j=0; j<3; j+) if ( max < aij ) max = aij; /*found*/ if (min > aij) min = aij; printf("The max is: %dn", max); printf("The min is: %dn", min); #include <math.h>#include <conio.h>#include <stdio.h>
9、void main() int a12=2,3,5,7,8,9,10,11,12,13,15,17,i,j,k,s; /*found*/ s=0; for ( i=0; i<12; i+) k=(int)sqrt(ai); for ( j=2;j <= k; j+)if (ai % j = 0) break; if( j>k ) /*found*/ s=s+ai; printf("Sum is: %dn",s); #include <stdio.h> #define M 100 void main() int a,b,i; a=0;b=0; /
10、*found*/ for(i=1;i<=M;i+=2) a+=i; /*found*/ b+=i+1; printf("sum of evens is %dn",b); printf("sum of odds is %dn",a); #include <math.h>#include <conio.h>#include <stdio.h> void main() int a12=2,3,5,7,8,9,10,11,12,13,15,17,i,j,k,s; /*found*/ s=0; for ( i=0; i&l
11、t;12; i+) k=(int)sqrt(ai); for ( j=2;j <= k; j+)if (ai % j = 0) break; if( j>k ) /*found*/ s=s+ai; printf("Sum is: %dn",s); #include <string.h> #include <stdio.h> int fun(char str1,char ch) /*begin*/ /*end*/ void main() void NONO( );/函數(shù)聲明 char str180,ch; int count; printf
12、("Enter str1:n"); gets(str1); printf("Enter ch:n"); ch=getchar(); count=fun(str1,ch); printf("Result is: %dn",count); NONO( ); void NONO( ) FILE *fr,*fw; int i, count; char str80, ch; fr=fopen("D:exam05910327PROGIN.DAT","r"); fw=fopen("D:exam05910327PROGOUT.DAT
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025至2031年中國中底卡釘機行業(yè)投資前景及策略咨詢研究報告
- 2025至2030年杏干項目投資價值分析報告
- 2025至2030年中國油灰數(shù)據(jù)監(jiān)測研究報告
- 2025至2030年中國大理石吊燈數(shù)據(jù)監(jiān)測研究報告
- 建筑人造石生產(chǎn)設(shè)備考核試卷
- 2025-2030年商用食物攪拌器企業(yè)制定與實施新質(zhì)生產(chǎn)力戰(zhàn)略研究報告
- 2025-2030年地下空洞穩(wěn)定性評估系統(tǒng)行業(yè)深度調(diào)研及發(fā)展戰(zhàn)略咨詢報告
- 2025-2030年可定制果糖禮盒企業(yè)制定與實施新質(zhì)生產(chǎn)力戰(zhàn)略研究報告
- 2025-2030年呼吸輔助訓(xùn)練器行業(yè)深度調(diào)研及發(fā)展戰(zhàn)略咨詢報告
- 2025-2030年敏感頭皮柔順護發(fā)素行業(yè)深度調(diào)研及發(fā)展戰(zhàn)略咨詢報告
- 鮮切水果行業(yè)分析
- 《中國探月工程》課件
- 義務(wù)教育物理課程標準(2022年版)測試題文本版(附答案)
- 第7章-無人機法律法規(guī)
- 藥劑科基本藥物處方用藥狀況點評工作表
- 初中音樂聽課筆記20篇
- 央國企信創(chuàng)化與數(shù)字化轉(zhuǎn)型規(guī)劃實施
- 拆遷征收代理服務(wù)投標方案
- 完形療法概述
- SL631-637-2012-水利水電工程單元工程施工質(zhì)量驗收評定標準
- 商標基礎(chǔ)知識課件
評論
0/150
提交評論