二级c语言题库(编辑修改稿)内容摘要:
(\nOutput from head:\n)。 outlist(head)。 printf(\nOutput from tail: \n)。 while (headnext != NULL){ fun(head)。 printf(\n\n)。 printf(\nOutput from head again :\n)。 outlist(head)。 } } 二、程序改错题 include /************found************/ fun (char a) { if ( *a ) { fun(a+1)。 /************found************/ printf(%c *a)。 } } main( ) { char s[10]=abcd。 printf(处理前字符串 =%s\n 处理后字符串 =, s)。 fun(s)。 printf(\n)。 } 三、程序编写题 include char *fun ( char *s, char *t) { } main( ) { char a[20],b[20]。 void NONO ( )。 printf(Input 1th string:)。 gets( a)。 printf(Input 2th string:)。 gets( b)。 printf(%s\n,fun (a, b ))。 NONO ()。 } void NONO ( ) {/* 本函数用于打开文件,输入数据,调用函数,输出数据,关闭文件。 */ FILE *fp, *wf。 int i。 char a[20], b[20]。 fp = fopen(K:\\k01\\24010001\\,r)。 wf = fopen(K:\\k01\\24010001\\,w)。 for(i = 0。 i 10。 i++) { fscanf(fp, %s %s, a, b)。 fprintf(wf, %s\n, fun(a, b))。 } fclose(fp)。 fclose(wf)。 } 第 7 套题 一、程序填空题 include include define N 8 typedef struct list { int data。 struct list *next。 } SLIST。 void fun( SLIST *h) { SLIST *p, *q。 p=hnext。 if (p!=NULL) { q=pnext。 while(q!=NULL) { if (pdata==qdata) { pnext=qnext。 /**********found**********/ free(___1___)。 /**********found**********/ q=p___2___。 } else { p=q。 /**********found**********/ q=q___3___。 } } } } SLIST *creatlist(int *a) { SLIST *h,*p,*q。 int i。 h=p=(SLIST *)malloc(sizeof(SLIST))。 for(i=0。 iN。 i++) { q=(SLIST *)malloc(sizeof(SLIST))。 qdata=a[i]。 pnext=q。 p=q。 } pnext=0。 return h。 } void outlist(SLIST *h) { SLIST *p。 p=hnext。 if (p==NULL) printf(\nThe list is NULL!\n)。 else { printf(\nHead)。 do { printf(%d,pdata)。 p=pnext。 } while(p!=NULL)。 printf(End\n)。 } } main( ) { SLIST *head。 int a[N]={1,2,2,3,4,4,4,5}。 head=creatlist(a)。 printf(\nThe list before deleting :\n)。 outlist(head)。 fun(head)。 printf(\nThe list after deleting :\n)。 outlist(head)。 } 二、程序改错题 include define N 20 void fun(int a[], int n) { int i, j, t, p。 for (j = 0。 j n1。 j++) { /************found************/ p = j for (i = j+1。 i n。 i++) if(a[i] a[p]) /************found************/ p = j。 t = a[p]。 a[p] = a[j]。 a[j] = t。 } } main() { int a[N]={9,6,8,3,1},i, m = 5。 printf(排序前的数据 :)。 for(i = 0。 i m。 i++) printf(%d ,a[i])。 printf(\n)。 fun(a,m)。 printf(排序后的数据 :)。 for(i = 0。 i m。 i++) printf(%d ,a[i])。 printf(\n)。 } 三、程序编写题 include define M 100 void fun ( int m, int *a , int *n ) { } main( ) { int aa[M], n, k。 void NONO ( )。 fun ( 50, aa, amp。 n )。 for ( k = 0。 k n。 k++ ) if((k+1)%20==0) printf(\n)。 else printf( %4d, aa[k] )。 printf(\n)。 NONO( )。 } void NONO ( ) {/* 本函数用于打开文件,输入数据,调用函数,输出数据,关闭文件。 */ FILE *fp, *wf。 int i, n, j, k, aa[M], sum。 fp = fopen(K:\\k01\\24010001\\,r)。 wf = fopen(K:\\k01\\24010001\\,w)。 for(i = 0。 i 10。 i++) { fscanf(fp, %d, amp。 j)。 fun(j, aa, amp。 n)。 sum = 0。 for(k = 0。 k n。 k++) sum+=aa[k]。 fprintf(wf, %d\n, sum)。 } fclose(fp)。 fclose(wf)。 } 第 8 套题 一、程序填空题 include include define N 8 typedef struct list { int data。 struct list *next。 } SLIST。 SLIST *creatlist(char *)。 void outlist(SLIST *)。 int fun( SLIST *h, char ch) { SLIST *p。 int n=0。 p=hnext。 /**********found**********/ while(p!=__0_1___) { n++。 /**********found**********/ if (pdata==ch) return _n__2___。 else p=pnext。 } return 0。 } main() { SLIST *head。 int k。 char ch。 char a[N]={39。 m39。 ,39。 p39。 ,39。 g39。 ,39。 a39。 ,39。 w39。 ,39。 x39。 ,39。 r39。 ,39。 d39。 }。 head=creatlist(a)。 outlist(head)。 printf(Enter a letter:)。 scanf(%c,amp。 ch)。 /**********found**********/ k=fun(___3___)。 if (k==0) printf(\nNot found!\n)。 else printf(The sequence number is : %d\n,k)。 } SLIST *creatlist(char *a) { SLIST *h,*p,*q。 int i。 h=p=(SLIST *)malloc(sizeof(SLIST))。 for(i=0。 iN。 i++) { q=(SLIST *)malloc(sizeof(SLIST))。 qdata=a[i]。 pnext=q。 p=q。 } pnext=0。 return h。 } void outlist(SLIST *h) { SLIST *p。 p=hnext。 if (p==NULL) printf(\nThe list is NULL!\n)。 else { printf(\nHead)。 do { printf(%c,pdata)。 p=pnext。 } while(p!=NULL)。 printf(End\n)。 } } 二、程序改错题 include include include fun ( char *p) { int i,t。 char c[80]。 /************found************/ For (i = 0,t = 0。 p[i]。 i++) if(!isspace(*(p+i))) c[t++]=p[i]。 /************found************/ c[t]=\0。 strcpy(p,c)。 } main( ) { char c,s[80]。 int i=0。 printf(Input a string:)。 c=getchar()。 while(c!=39。 39。 ) { s[i]=c。 i++。 c=getchar()。 } s[i]=39。 \039。 fun(s)。 puts(s)。 } 三、程序编写题 include include void fun ( char *ss ) { } main( ) { char tt[81]。 void NONO ( )。 printf( \nPlease enter an string within 80 characters:\n )。 gets( tt )。 printf( \n\nAfter changing, the string\n \%s\, tt )。 fun( tt )。 printf( \n。二级c语言题库(编辑修改稿)
相关推荐
、3分的加分()。 5.加减分(10分)在考核期内,教师考核的加减分内容参照《教师奖惩管理实施细则》执行。 第5条 考核组织和领导学校成立以校长为组长的绩效考核管理领导小组,对本校教师绩效考核实行动态管理,跟踪考核。 第6条 考核时间和方式教师绩效考核工作分为平时绩效考核、学期绩效考核和学年度绩效考核,平时绩效考核重点考核教师履行岗位职责、完成学校规定的教育教学工作任务以及出勤情况。
, 茂盛,是蝴蝶 的好地方。 ( 2)、随风潜入夜,。 ( 3)、蜗牛长着一对有力的确良 ,能在空中 飞翔。 用下面的词语排列句子,再加上标点。 ( 4 分) ( 1)这样 人们 徐虎 为什么 呢 称赞 ( 2)大批 蝴蝶谷 游客 吸引了 中外 美丽的 给下面的句子添上合适的词语,使句子的意思更具体( 2 分) ( 1)河水绕着村子 地流着。 ( 2)荷叶像 ,静静地在荷塘举着。 四、口语交际(
类地址的是( )。 ( FTTX) A 、 B 、 C 、 D 57. 下面关于 VLAN 描述正确的是 ( ) ( FTTX) A 一个 VLAN 一个广播域 、 B 一个 VLAN 一个冲突域、 C 一个 VLAN 只能包含一个物理端口、 D VLAN 只能按照端口进行划分 58. 主机地址 ( )。 ( FTTX) A 、 B 、 C 、 D。 59. EPON
帐号: 电话: 电话: 日期: 年 月 日 日期: 年 月 日 第 2 页 共 2 页 中标货物 供货协议 甲方(需方): XXXX生物高新技术 股份 有限公司 乙方( 供 方) : XXXX 医疗仪器有限公司 经供方、需方充分协商,签订本 协议。 2. 商品名称、种类、规格、单位、数量、 价格 序号 货物名称 规格型号 单位 数量 单价
d\n:%4d,age[i])。 printf(\n\n)。 fun(age,d)。 for(i=0。 i10。 i++)printf(%4d%4d:%4d\n,i*10,i*10+9,d[i])。 printf(Over100:%4d\n,d[10])。 NONO(d)。 } 解题思路: 本题是统计各年龄段的人数。 0。 for循环以及求出各年龄的十位数字作为存放人数的地址,如果大于值大于
一段长导管时,拔管速度要慢,以防止桩顶沉淀的泥浆挤入导管下形成泥心。 因为耐久性混凝土粉煤灰掺量较大,粉煤灰可能上浮堆积在桩头,加灌高度要考虑此因素。 为确保桩顶质量,在桩顶设计标高以上须加灌 100cm,以便灌注结束后将此段混凝土清除。 ,在灌注前须进行坍落度、含气量、入模温度等检测;在各灌注时间、混凝土面的深度、导管埋深、导管拆除以及发生的异常现象等,须指定专人进行记录。 灌注水下砼时