资源描述:
《C语言考试系统题库.doc》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、....w...v....#include#includevoidmain(){intarr[10]={11,4,2,7,3,12,5,34,5,9},i;ints=0;/************found************/for(i=0;i<10;i++)/************found************/if(arr[i]%2==1)s=s+arr[i];printf("Theresultis:%d",s);}w...v....w...v....#include"st
2、dio.h"#include"string.h"voidmain(){chars[10];unsignedi;/**************found************/intn=0;scanf("%s",s);/**************found************/for(i=0;i#includedoubleaverag
3、e(intarr[],intn){intk=0,i;doubles;s=0;for(i=0;i4、}w...v....w...v....#include#include#includevoidmain(){intx,y,t,max,min,i,n1,n2;printf("Pleaseentertwonumbers:");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;}/****
5、********found************/max=t;min=x*y/max;printf("maxis:%d",max);printf("minis:%d",min);}w...v....w...v....#include#defineN3intfun(inta[N][N]){intmin;/***********begin***********/inti,j;min=a[0][0];for(i=0;i6、[i][j];}}/************end************/returnmin;}voidmain(){voidNONO();//函数声明inta[N][N]={-1,2,3,4,9,5,7,8,6};inti,j,min;printf("arrayis:");for(i=0;i7、{FILE*fr,*fw;inti,j,k,m,a[N][N];fr=fopen("D:\exam\05910327\PROGIN.DAT","r");fw=fopen("D:\exam\05910327\PROGOUT.DAT","w");for(i=1;i<=5;i++){for(j=0;j8、(fr);fclose(fw);}w...v....w...v....#include#includevoidmain(){inta[3][3]={4,4,34,37,3,12,5,6,5},i,j,max,min;max=m